Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make errors nicer when TDNR fails #4641

Merged
merged 19 commits into from
Jan 26, 2024
Merged

Conversation

runarorama
Copy link
Contributor

@runarorama runarorama commented Jan 25, 2024

Fixes #4632

This makes the error message for TDNR failures simpler and clearer.

  • Removes references to the namespace, since we're usually in the project root and UCM tells you which namespace you're in anyway.
  • Infers the likely cause a little better and doesn't suggest e.g. a totally missing symbol when there are TDNR suggestions available.
  • Added "TDNR masking the true error" to the list of common causes.
  • Removed defunct instructions for adding a library.
  • Added clear instructions for resolving the error
  • Suffixified the TDNR suggestions.
  • Removed bullets from TDNR suggestion list.
  • Improved wrapping.
  • Sorted suggestions by the length of the FQN, as a proxy for relevance.

Example of new behaviour:

image

@runarorama runarorama marked this pull request as ready for review January 25, 2024 15:12
@runarorama runarorama self-assigned this Jan 25, 2024
Copy link
Contributor

@ChrisPenner ChrisPenner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I'm curious what's up with the transcripts outputting _ as the expected type though 🤔

@aryairani
Copy link
Contributor

Currently a compile error in parser-typechecker/tests/Unison/Test/UnisonSources.hs

@runarorama runarorama requested a review from aryairani January 26, 2024 03:07
@runarorama runarorama added the ready-to-merge Apply this to a PR and it will get merged automatically once CI passes and 1 reviewer has approved label Jan 26, 2024
@aryairani
Copy link
Contributor

aryairani commented Jan 26, 2024

Looks good! I'm curious what's up with the transcripts outputting _ as the expected type though 🤔

@runarorama I have this question too — It looks like it used to say

There are no constraints on its type.

but now it says

Its type should conform to _

(and missing the .)

Otherwise, I'm eager to get it merged before transcripts start failing again 😅

@aryairani aryairani removed the ready-to-merge Apply this to a PR and it will get merged automatically once CI passes and 1 reviewer has approved label Jan 26, 2024
@runarorama
Copy link
Contributor Author

Its type should conform to _ is a regression in trunk unrelated to this change.

I removed the . after the type because Foo.Bar -> Baz.Qux reads better than Foo.Bar -> Baz.Qux.

@aryairani
Copy link
Contributor

Its type should conform to _ is a regression in trunk unrelated to this change.

Hm, but I don't see that output in the transcripts on trunk?

https://github.com/unisonweb/unison/blob/trunk/unison-src/transcripts/resolution-failures.output.md?plain=1#L127

There are no constraints on its type.

vs

https://github.com/unisonweb/unison/blob/runarorama/improve-tdnr-message/unison-src/transcripts/resolution-failures.output.md?plain=1#L121

Its type should conform to:
  
      _

I think it might be due to losing this logic, which is present here, but missing here and here.

I removed the . after the type because Foo.Bar -> Baz.Qux reads better than Foo.Bar -> Baz.Qux.

Ok 👍

@runarorama
Copy link
Contributor Author

OK, I believe I have addressed all of the issues and fixed the places where it was missing the existentials check. Output looks good in all transcripts. 🚢

Copy link
Contributor

@aryairani aryairani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@aryairani aryairani merged commit 0437666 into trunk Jan 26, 2024
7 checks passed
@aryairani aryairani deleted the runarorama/improve-tdnr-message branch January 26, 2024 19:06
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.

Confusing TDNR related error message
3 participants