-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Diagnostics] Introduce getLoc
and getSourceRange
to failure diagnostic
#30967
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
This is still a draft because I need to clean up some things here and there but I'd want to get early opinion on the changes. Please take a look! |
The idea is that |
180a5a7
to
faf046a
Compare
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.
Looks great!
…nchor` Some of the diagnostics have special rules about anchor location, let's make `getAnchor` virtual and allow sub-class to override default implementation.
Split `emitDiagnostic` into `emitDiagnostic` and `emitDiagnosticAt`. Refactor existing diagnostics to use new methods and avoid passing location when possible.
faf046a
to
ce324d3
Compare
@hamishknight Thanks for the review, I've fixed both problems you have mentioned. |
@swift-ci please smoke test |
@swift-ci please smoke test Linux platform |
Since there is no opposition here I'm going to merge this and next up is removal of |
Some of the diagnostics have special rules about anchor location,
let's make
getAnchor
virtual and allow sub-class to overridedefault implementation.
Split
emitDiagnostic
intoemitDiagnostic
andemitDiagnosticAt
,where former passes
getLoc
internally.Refactor existing diagnostics to use new methods and avoid passing
location when possible.