Skip to content

parser: fix eval fixed array size#25409

Merged
spytheman merged 1 commit into
vlang:masterfrom
kbkpbot:fix-parser-eval-fixed-array-size
Sep 28, 2025
Merged

parser: fix eval fixed array size#25409
spytheman merged 1 commit into
vlang:masterfrom
kbkpbot:fix-parser-eval-fixed-array-size

Conversation

@kbkpbot

@kbkpbot kbkpbot commented Sep 28, 2025

Copy link
Copy Markdown
Contributor

Fix issue #25404

BTW, I think we should remove eval_array_fixed_sizes() from parser. Because in parser, it has no full information, for example, [2][const_a - sizeof(T)]int{}, sizeof(T) is ready in checker. And checker also has it's own eval_array_fixed_sizes().

@spytheman

Copy link
Copy Markdown
Contributor

BTW, I think we should remove eval_array_fixed_sizes() from parser.

I agree completely - the checker is more suitable to calculate it.

}
}
ast.Ident {
if mut const_field := p.table.global_scope.find_const(size_expr.full_name().all_after('builtin.')) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the .all_after('builtin.') needed ?

@vlang vlang deleted a comment from huly-for-github Bot Sep 28, 2025
@spytheman spytheman merged commit 8e9f412 into vlang:master Sep 28, 2025
83 checks passed
blackshirt pushed a commit to blackshirt/v that referenced this pull request Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants