Skip to content

checker: fix unknown fixed array size - #21548

Merged
spytheman merged 7 commits into
vlang:masterfrom
Delta456:arr_fixed_size
May 23, 2024
Merged

spytheman merged 7 commits into
vlang:masterfrom
Delta456:arr_fixed_size

Conversation

@Delta456

Copy link
Copy Markdown
Member

Fixed #21544

@Delta456

Copy link
Copy Markdown
Member Author

Would require help to fixing the issue

@spytheman
spytheman marked this pull request as ready for review May 23, 2024 14:53
Comment thread vlib/v/checker/comptime.v
return cast_expr_value.i64() or { return none }
}
if expr.typ == ast.int_type {
return cast_expr_value.i64() or { return none }

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.

I still do not understand why it has to be return cast_expr_value.i64() or { return none } here πŸ€” ...

It would have been more logical to be cast_expr_value.int() instead, but this leads to an error later.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I was thinking of using .int()as well but it errors later. I think it's due to int_literal

@spytheman
spytheman merged commit ef758a7 into vlang:master May 23, 2024
@Delta456
Delta456 deleted the arr_fixed_size branch July 26, 2024 18:09
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.

calculated const causes failure when used as fixed array size

2 participants