cgen: fix comptime match assign in generic fn, T.name string intp#26597
Merged
Conversation
spytheman
reviewed
Feb 13, 2026
spytheman
reviewed
Feb 13, 2026
spytheman
reviewed
Feb 13, 2026
spytheman
reviewed
Feb 13, 2026
spytheman
reviewed
Feb 13, 2026
| node_.expr_types[i] = field_typ | ||
| } else if field_typ != ast.void_type { | ||
| if i >= node_.expr_types.len { | ||
| node_.expr_types << field_typ |
Contributor
There was a problem hiding this comment.
same - restore this to just node_.expr_types[i] = field_typ; there is no need for the if i >= node_.expr_types.len { check, and it can make other problems harder, since it does something more suited for the checker
Member
Author
There was a problem hiding this comment.
Not having this guard is giving index out of range for me :/
spytheman
suggested changes
Feb 13, 2026
a491df9 to
81cd715
Compare
81cd715 to
ec2de2f
Compare
Delta456
approved these changes
Feb 14, 2026
spytheman
approved these changes
Feb 16, 2026
spytheman
left a comment
Contributor
There was a problem hiding this comment.
Thank you @dy-tea 🙇🏻 .
I am still not convinced that line 379 with the <<, is needed, because I did a local run where it was replaced by a panic, and v test-all passed. I'll experiment more, and make a separate PR for it, to make it run the full CI, without blocking this further.
cestef
pushed a commit
to cestef/v
that referenced
this pull request
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #26053.
Hopefully more of this logic can be moved out of cgen in v2. Checks already passed on my branch.