-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Diagnostic verifier] Reject diagnostics at '<unknown>:0' by default #7197
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
Added frontend option '-verify-ignore-unknown'
…toclosure.swift Now that '-verify' mode take care of this.
d231a7b
to
019daba
Compare
@jrose-apple What do you think? |
// <unknown>:0: error: unexpected error produced: only classes and class members may be marked with 'final' | ||
// <unknown>:0: error: unexpected error produced: only classes and class members may be marked with 'final' | ||
// <unknown>:0: error: unexpected error produced: only classes and class members may be marked with 'final' | ||
// <unknown>:0: error: unexpected error produced: only classes and class members may be marked with 'final' |
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.
#7179 will fix this.
Ooh, this is a good idea, although I'm sad about how many we seem to have. I'd like someone else to take a look too, maybe @bitjammer or @modocache? |
I think most of them are missing implementation of |
At this point I'm not sure we really consider that "missing"; we really shouldn't emit errors or warnings on imported declarations, ever. |
@jrose-apple What about a "note: declared here" type of thing? That should use the decl as the location so it prints correctly right? |
That's the intent, yes—any of those notes should result in printing into a synthetic buffer for now. We've also long talked about having an "IDE mode" where a USR is used as the "location", so that Xcode can actually show the generated interface as it usually does. In neither case is the location reported as "unknown". |
@swift-ci Please test |
This looks good to me. Starter bug: eliminate |
@swift-ci Please smoke test and merge |
Previously, in
-verify
mode, diagnostics for invalid locations were silently ignored.However, most of them are unintentional, and unhelpful for users.
I think we should eliminate them where possible.
In this PR,
-verify
mode catch them and report them as failure by default.Added
-verify-ignore-unknown
frontend option for opting-out this feature.