vxx2 / vlib / v / checker / tests / if_smartcast_mutation_err.vv
8 lines · 7 sloc · 100 bytes · dff5b1e58122fd131c5ec38b27d095741559a9a6
Raw
1type SmartcastValue = int | string
2
3fn main() {
4 a := SmartcastValue(1)
5 if a is int {
6 a = 3
7 }
8}
9