-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
fix Issue 18528 - dmd should deduplicate identical errors #15306
Conversation
Thanks for your pull request, @WalterBright! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#15306" |
b5d2218
to
0aa421d
Compare
Still an amazing number of diffs. |
I suppose you've already tried node-based suppression? I think the most common entrypoint for errors are the wrapper methods Do we already refuse to emit errors/deprecation if the errors field is already set? |
A lot of that is done. The trouble is it is not a general solution, and I was looking for a general solution. But as this PR shows, I'm thinking I should look again at the node base solution, as this one is a bit too blunt. Just adding the check to the |
The specific message for this bugzilla is:
is not so easy to deal with without adding complexity. |
Only supplemental messages relating to the same error? Other supplemental messages should be fine to emit. Back traces being one such example where it is desired to have the same line twice. |
I don't see it scaling well to always wrap grouped errors up into an if block - maybe a lambda? |
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.
Thanks for taking care of this. A few notes:
- stop adding #line directives to test files.
- please delete the newly added extra lines in the test files.
- updating the failure tests can be done automatically by running ./AUTO_UPDATE = 1 ./run.d test (except for test files where there are multiple error sections)
- the current implementation is going to suppress some error messages when it shouldn't given that it takes only the location of the error message. This can already be observed in some of the modified test suite files. I assume there are other situations when we prune error messages when we shouldn't. Maybe a better way to do it is to the hash of the error message?
|
||
/************************************************************ | ||
* This is a simple scheme to eliminate duplication of error | ||
* messages, which we'll define has having the same location. |
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.
* messages, which we'll define has having the same location. | |
* messages, which we'll define as having the same location. |
* The complication is that messages come in groups, | ||
* all with the same location. This is dealt with by having | ||
* some messages trigger the start of a group, which ends only | ||
* when another start is seen, at wich point the previous location |
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.
* when another start is seen, at wich point the previous location | |
* when another start is seen, at which point the previous location |
|
||
|
||
|
||
|
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.
Please delete these extra lines.
--- | ||
*/ | ||
|
||
|
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.
this change is unrelated to this PR
compilable/ddoc10236.d(71): Warning: Ddoc: parameter count mismatch, expected 2, got 0 | ||
compilable/ddoc10236.d(71): Note that the format is `param = description` | ||
--- | ||
*/ | ||
|
||
|
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.
this change is unrelated to this PR
compilable/sw_transition_complex.d(132): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead | ||
--- | ||
*/ | ||
|
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.
undo
|
||
|
||
|
||
|
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.
ditto
--- | ||
*/ | ||
|
||
|
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.
ditto
@@ -8,7 +8,6 @@ fail_compilation/cpp_abi_tag.d(102): Error: `@gnuAbiTag` at least one argument e | |||
fail_compilation/cpp_abi_tag.d(105): Error: `@gnuAbiTag` at least one argument expected | |||
fail_compilation/cpp_abi_tag.d(108): Error: `@gnuAbiTag` char `0x99` not allowed in mangling | |||
fail_compilation/cpp_abi_tag.d(114): Error: argument `2` to `@gnuAbiTag` cannot be `null` | |||
fail_compilation/cpp_abi_tag.d(114): Error: argument `3` to `@gnuAbiTag` cannot be empty |
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.
I don't think this message should be elided.
--- | ||
*/ | ||
|
||
#line 100 |
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.
Please, stop adding #line directives. This makes reviewing the code much more difficult.
Reboot #15303 with different approach, hopefully much less disruptive.