-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
checker: check invalid comptime field name assignment #24421
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
Connected to Huly®: V_0.6-22793 |
vlib/v/checker/match.v
Outdated
mut old_inside_x_matches_type := c.inside_x_matches_type | ||
if is_type_node { | ||
c.inside_x_matches_type = true | ||
old_inside_x_matches_type = c.inside_x_matches_type | ||
} | ||
expr_type := c.expr(mut expr) | ||
if is_type_node { | ||
c.inside_x_matches_type = old_inside_x_matches_type | ||
} |
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.
That essentially still sets c.inside_x_matches_type
to true permanently for the rest of the analyzed .v file (in the checker instance), but in a more complicated way, compared to before.
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.
What will set it back to false, once it becomes true?
If it should be permanently true, why have the bool field at all?
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.
Right. I am overthinking. Mind if you can solve this issue?
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 just removed the field completely.
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.
The checks are still failing
https://github.com/vlang/v/actions/runs/15005148584/job/42161765731?pr=24421
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.
should be fixed now
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.
Can we also add a test case for #24421 (comment) ?
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'll add a test tomorrow, since it is pretty late here, and it will need several nested $for and matches.
…ath { sin, cos }`" This reverts commit ddf0468.
This reverts commit a0b6653.
…ther to just comptime_for for fields
Fixes #24415