-
Notifications
You must be signed in to change notification settings - Fork 291
Add to an error message to address issue #5722 #5830
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
Conversation
|
Thanks @dolio; could you add a transcript that demos the error message? And then good to go. |
| "signature does not specify the abilities used. It may also be from a\n", | ||
| "variable introduced by an ability match escaping its scope.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor thing. Anytime you're editing error messages, it's a good opportunity to switch away from using hard linebreaks - hard linebreaks result in weird rendering depending on the user's terminal width. It's a bit of longstanding tech debt that the dynamic wrapping is used inconsistently in our error messages.
You can follow other examples in this file which use the pretty-printing library to get it to wrap dynamically based on the width of the terminal, using Pr.wrap, Pr.lines, etc.
I wouldn't necessarily hold up a PR just for this, but it's an example of "leave the code a bit nicer than you found it". :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, great. I would have done this to begin with, but for some reason I thought we didn't do auto-wrapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In retrospect, it wasn't that I thought we couldn't do wrapping. It's that I didn't understand how to use the wrapping combinator correctly (just on a single paragraph you want wrapped). So before when I tried to use it, it would crush my message into a single blob.
The message is now properly wrapped.
|
BTW, the transcript from #5825 will have the error message. It's the same error message regardless of how it gets triggered, because I don't think it's easy to tell the two cases apart. I think that's why the transcripts are failing. I forgot to re-run them and check in the new message. |
|
BTW, I have some other transcripts that change locally on rerun, but they don't have anything to do with what I changed here. Edit: I guess this has been fixed in a newer trunk than I forked from. |
This adjusts the error message from #5825 to address the situation in in #5722. The latter triggers the same failure in the type checker, but the reason is different. In this case it's just an ability match introducing a type variable that is not allowed to escape the scope, but will as written.