You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by alfaus October 15, 2023
If you use a typed constant in a match range expression, for example:
const (
a = u16(1)
b = u16(5)
)
c := u16(3)
match c {
a...b { println('1...5') }
else { println('not 1...5') }
}
you get a compiler error: 'match branch range expressions need the start value to be known at compile time (only enums, const or literals are supported)'
Maybe u16(1) is not a type conversion but a function call? I've read functions in constant definition are evaluated at runtime.
I don't know if this is a bug or a feature...
> [!NOTE]
> You can vote for this issue using the 👍 reaction. More votes increase the issue's priority for developers.
>
> Take into account that only the 👍 reaction counts as a vote.
> Only reactions to the issue itself will be counted as votes, not comments.
The text was updated successfully, but these errors were encountered:
Discussed in #19570
Originally posted by alfaus October 15, 2023
If you use a typed constant in a match range expression, for example:
you get a compiler error: 'match branch range expressions need the start value to be known at compile time (only enums, const or literals are supported)'
Maybe u16(1) is not a type conversion but a function call? I've read functions in constant definition are evaluated at runtime.
I don't know if this is a bug or a feature...
The text was updated successfully, but these errors were encountered: