vxx2 / vlib / v / checker / tests / infix_value_ref_comparison_err.vv
20 lines · 17 sloc · 243 bytes · 1f5df6f827d46728321ed9fec3fe7d53c7b9df04
Raw
1type Abc = int | string
2
3fn plain_value_ref_comparison() {
4 value := 1
5 reference := &value
6 _ = value == reference
7}
8
9fn sumtype_value_ref_comparison() {
10 b := 1
11 a := Abc(b)
12 match a {
13 int {
14 _ = a == &b
15 }
16 else {}
17 }
18}
19
20fn main() {}
21