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
Type Switch does not modify the variable and the compiler throws an error
Current Behavior
Type switch can modify the variable
Steps to Reproduce
U :: union {
int,
bool,
}
ar := [3]U{1, 3, false}
for u in ar {
switch &v in u {
case int :
v = 2 // this should've thrown an error as u should be immutable
assert(u == 2)
case bool :
v = true // this should too
assert(u == true)
}
}
Failure Logs
The text was updated successfully, but these errors were encountered:
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Expected Behavior
Type Switch does not modify the variable and the compiler throws an error
Current Behavior
Type switch can modify the variable
Steps to Reproduce
Failure Logs
The text was updated successfully, but these errors were encountered: