-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Error reporting improvements #99
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Do all individual commits compile? |
That's all |
We could eliminate the redundant "show"s while we are at it, but it's not critical to do it now. Otherwise, looks good to me. |
@samuelgruetter Can you remerge please? Then this can go in IMO. |
remove all isSensical/SuppressedMessage logic from InfoString
decouple Diagnostic from ContextBase
Diagnostic and might be nonsensical Conflicts: src/dotty/tools/dotc/typer/Checking.scala src/dotty/tools/dotc/typer/TypeAssigner.scala
Conflicts: src/dotty/tools/dotc/typer/TypeAssigner.scala
rebased and addressed comments @gzm0 |
LGTM, sorry for being so late. My phone wouldn't send my comment and I forgot. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In today's meeting, it was decided that error-specific Diagnostics classes will be introduced, but only later, so that we can quickly & easily create string error messages as long as things change quickly.
So this PR leaves error-reporting as string-based as it was before, and only makes a few improvements to error-reporting which should be applied already now. The advantages are the following:
Instead of only the i string interpolator, there are now two: i and d.
Originally, the i"..." string interpolator added three features to the s interpolator:
show
is called instead oftoString
%
signs, egi"myList = (${myList}%, %)"
This PR removes 3) from the i interpolator, and adds the d interpolator, which does 1), 2) and 3), but instead of throwing SuppressedMessage execptions, it just marks the returned string with opening and closing "nonsensical" tags.
When should which interpolator be used:
Ideally, d"..." would return a "magical data structure" which stores the message string and whether it's sensical or not (as sketched in today's meeting). However, this is not possible as long as we want to have all string operations (concatenation, stripMargin, interpolation, etc) on strings generated with d.
I agree that the way nonsensical error messages are marked in this PR is not very nice, and this PR is definitely not the final solution, but looking at the above list of improvements, I think it's still worth applying it.