v/vlib/v/checker/tests/if_mut_with_immutable_var_e...

12 lines
123 B
V
Raw Normal View History

2022-04-15 17:34:15 +02:00
type Int = int | u8
fn main() {
i := Int(0)
if mut i is int {
i = 1
2022-04-15 17:34:15 +02:00
} else if mut i is u8 {
i = 2
}
println(i)
}