Skip to content

Improve row type error messages#4159

Merged
rhendric merged 1 commit intopurescript:masterfrom
rhendric:rhendric/fix-3701
Jul 26, 2021
Merged

Improve row type error messages#4159
rhendric merged 1 commit intopurescript:masterfrom
rhendric:rhendric/fix-3701

Conversation

@rhendric
Copy link
Copy Markdown
Member

  • Remove a redundant hint that repeats the types in the error
  • Correctly diff rows containing duplicate items
  • Erase kind applications from rows in errors (by default)

Description of the change

Fixes #3701.


Checklist:

  • Added a file to CHANGELOG.d for this PR (see CHANGELOG.d/README.md)
  • Linked any existing issues or proposals that this pull request should close
  • Added a test for the contribution (if applicable)

* Remove a redundant hint that repeats the types in the error
* Correctly diff rows containing duplicate items
* Erase kind applications from rows in errors (by default)
@garyb
Copy link
Copy Markdown
Member

garyb commented Jul 18, 2021

Maybe it's just me, but the errors that needed updating in the prior examples seems worse / harder to interpret now? I'd like to be convinced that I'm wrong though, that's just my initial reaction from looking at the diffs. (I realise this in in the "hint" part of the error too, so the main part is unaffected at least).

@rhendric
Copy link
Copy Markdown
Member Author

No, I agree that they aren't great hints. But the hints being replaced were literally copies of the main error message, so this has to be some sort of improvement over that at least.

I was separately thinking that these hints might be improved if we used the post-substitution types instead of pre-substitution, but I thought I'd see how #4163 shakes out before changing anything in that part of the code.

@mikesol
Copy link
Copy Markdown

mikesol commented Jul 21, 2021

No, I agree that they aren't great hints. But the hints being replaced were literally copies of the main error message, so this has to be some sort of improvement over that at least.

I was separately thinking that these hints might be improved if we used the post-substitution types instead of pre-substitution, but I thought I'd see how #4163 shakes out before changing anything in that part of the code.

It looks like there was a minor readability improvement (only two .out files changed). I'm not sure if they'll have any impact here.

@JordanMartinez
Copy link
Copy Markdown
Contributor

Are there any other objections to this? Or can we get another approval and get this merged?

@rhendric rhendric merged commit 65213e7 into purescript:master Jul 26, 2021
@rhendric rhendric deleted the rhendric/fix-3701 branch July 26, 2021 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record type errors are sometimes duplicated

6 participants