-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 error reporting the wrong line for struct field inits #13502
Conversation
src/Sema.zig
Outdated
const default_val = sema.resolveMaybeUndefVal(&block_scope, .unneeded, coerced) catch |err| switch (err) { | ||
error.NeededSourceLocation => { |
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.
Doing this check for resolveMaybeUndefVal
isn't very useful but it should be done before the call to failWithNeededComptime
.
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.
Would you prefer I wait a bit until #13532 gets merged, and then fix this and rebase?
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.
There is going to be merge conflicts either way so it doesn't really matter though I'll probably want Andrews opinion on that change so this might be able to get merged first.
Didn't have access to my dev machine until now. |
* point to init part of field delc when that's where the error occurs * update test to reflect fixed error message * only lookup source location in case of error
fixes #12752
Before:
Afer: