diff --git a/vlib/v/checker/tests/sum_type_mutable_cast_err.out b/vlib/v/checker/tests/sum_type_mutable_cast_err.out index a70b863c89..a880221f43 100644 --- a/vlib/v/checker/tests/sum_type_mutable_cast_err.out +++ b/vlib/v/checker/tests/sum_type_mutable_cast_err.out @@ -1,14 +1,14 @@ -vlib/v/checker/tests/sum_type_mutable_cast_err.vv:23:10: error: cannot use operator `+` with `Abc` - 21 | mut x := Abc(0) - 22 | if x is int { - 23 | _ := x + 5 +vlib/v/checker/tests/sum_type_mutable_cast_err.vv:15:10: error: cannot use operator `+` with `Abc` + 13 | mut x := Abc(0) + 14 | if x is int { + 15 | _ := x + 5 | ^ - 24 | } - 25 | mut f2 := Foo2{Bar2{Abc(0)}} -vlib/v/checker/tests/sum_type_mutable_cast_err.vv:27:8: error: undefined ident: `f` - 25 | mut f2 := Foo2{Bar2{Abc(0)}} - 26 | if f2.b.a is int { - 27 | _ := f.b.a + 5 - | ^ - 28 | } - 29 | } \ No newline at end of file + 16 | } + 17 | mut f := Foo{Bar{Abc(0)}} +vlib/v/checker/tests/sum_type_mutable_cast_err.vv:19:14: error: cannot use operator `+` with `Abc` + 17 | mut f := Foo{Bar{Abc(0)}} + 18 | if f.b.a is int { + 19 | _ := f.b.a + 5 + | ^ + 20 | } + 21 | } diff --git a/vlib/v/checker/tests/sum_type_mutable_cast_err.vv b/vlib/v/checker/tests/sum_type_mutable_cast_err.vv index fcea074ff1..d122a1280d 100644 --- a/vlib/v/checker/tests/sum_type_mutable_cast_err.vv +++ b/vlib/v/checker/tests/sum_type_mutable_cast_err.vv @@ -9,21 +9,13 @@ struct Foo { b Bar } -struct Bar2 { - a Abc -} - -struct Foo2 { - b Bar2 -} - fn main() { mut x := Abc(0) if x is int { _ := x + 5 } - mut f2 := Foo2{Bar2{Abc(0)}} - if f2.b.a is int { + mut f := Foo{Bar{Abc(0)}} + if f.b.a is int { _ := f.b.a + 5 } }