diff --git a/gnovm/pkg/gnolang/preprocess.go b/gnovm/pkg/gnolang/preprocess.go index ee2c17934a3..9011cbb44a9 100644 --- a/gnovm/pkg/gnolang/preprocess.go +++ b/gnovm/pkg/gnolang/preprocess.go @@ -1411,7 +1411,7 @@ func preprocess1(store Store, ctx BlockNode, n Node) Node { if isUntyped(at) { switch arg0.Op { case EQL, NEQ, LSS, GTR, LEQ, GEQ: - assertAssignableTo(n, at, ct) + mustAssignableTo(n, at, ct) default: checkOrConvertType(store, last, n, &n.Args[0], ct) } @@ -1441,7 +1441,7 @@ func preprocess1(store Store, ctx BlockNode, n Node) Node { _, atIface := atBase.(*InterfaceType) if ctIface { // e.g. (...) - assertAssignableTo(n, at, ct) + mustAssignableTo(n, at, ct) // The conversion is legal, set the target type. n.SetAttribute(ATTR_TYPEOF_VALUE, ct) return n, TRANS_CONTINUE @@ -1819,12 +1819,12 @@ func preprocess1(store Store, ctx BlockNode, n Node) Node { for i, tv := range argTVs { if hasVarg { if (len(spts) - 1) <= i { - assertAssignableTo(n, tv.T, spts[len(spts)-1].Type.Elem()) + mustAssignableTo(n, tv.T, spts[len(spts)-1].Type.Elem()) } else { - assertAssignableTo(n, tv.T, spts[i].Type) + mustAssignableTo(n, tv.T, spts[i].Type) } } else { - assertAssignableTo(n, tv.T, spts[i].Type) + mustAssignableTo(n, tv.T, spts[i].Type) } } } else { @@ -2835,7 +2835,10 @@ func parseMultipleAssignFromOneExpr( for i := range nameExprs { if st != nil { tt := tuple.Elts[i] - if checkAssignableTo(n, tt, st) != nil { + if err := checkAssignableTo(n, tt, st); err != nil { + if debug { + debug.Printf("checkAssignableTo fail: %v\n", err) + } panic( fmt.Sprintf( "cannot use %v (value of type %s) as %s value in assignment", @@ -4069,7 +4072,7 @@ func checkOrConvertType(store Store, last BlockNode, n Node, x *Expr, t Type) { } if cx, ok := (*x).(*ConstExpr); ok { // e.g. int(1) == int8(1) - assertAssignableTo(n, cx.T, t) + mustAssignableTo(n, cx.T, t) } else if bx, ok := (*x).(*BinaryExpr); ok && (bx.Op == SHL || bx.Op == SHR) { xt := evalStaticTypeOf(store, last, *x) if debug { @@ -4077,7 +4080,7 @@ func checkOrConvertType(store Store, last BlockNode, n Node, x *Expr, t Type) { } if isUntyped(xt) { // check assignable first, see: types/shift_b6.gno - assertAssignableTo(n, xt, t) + mustAssignableTo(n, xt, t) if t == nil || t.Kind() == InterfaceKind { t = defaultTypeOf(xt) @@ -4086,13 +4089,13 @@ func checkOrConvertType(store Store, last BlockNode, n Node, x *Expr, t Type) { bx.assertShiftExprCompatible2(t) checkOrConvertType(store, last, n, &bx.Left, t) } else { - assertAssignableTo(n, xt, t) + mustAssignableTo(n, xt, t) } return } else if *x != nil { xt := evalStaticTypeOf(store, last, *x) if t != nil { - assertAssignableTo(n, xt, t) + mustAssignableTo(n, xt, t) } if isUntyped(xt) { // Push type into expr if qualifying binary expr. @@ -4144,7 +4147,7 @@ func checkOrConvertType(store Store, last BlockNode, n Node, x *Expr, t Type) { } else if ux, ok := (*x).(*UnaryExpr); ok { xt := evalStaticTypeOf(store, last, *x) // check assignable first - assertAssignableTo(n, xt, t) + mustAssignableTo(n, xt, t) if t == nil || t.Kind() == InterfaceKind { t = defaultTypeOf(xt) @@ -4241,7 +4244,7 @@ func convertIfConst(store Store, last BlockNode, n Node, x Expr) { func convertConst(store Store, last BlockNode, n Node, cx *ConstExpr, t Type) { if t != nil && t.Kind() == InterfaceKind { if cx.T != nil { - assertAssignableTo(n, cx.T, t) + mustAssignableTo(n, cx.T, t) } t = nil // signifies to convert to default type. } diff --git a/gnovm/pkg/gnolang/type_check.go b/gnovm/pkg/gnolang/type_check.go index 462124239e6..f9b24c3f5b0 100644 --- a/gnovm/pkg/gnolang/type_check.go +++ b/gnovm/pkg/gnolang/type_check.go @@ -207,9 +207,12 @@ func checkSame(at, bt Type, msg string) error { return nil } -func assertAssignableTo(n Node, xt, dt Type) { +func mustAssignableTo(n Node, xt, dt Type) { err := checkAssignableTo(n, xt, dt) if err != nil { + if debug { + debug.Printf("checkAssignableTo fail: %v\n", err) + } panic(err.Error()) } } @@ -734,7 +737,13 @@ func (x *BinaryExpr) AssertCompatible(lt, rt Type) { case EQL, NEQ: assertComparable(xt, dt) if !isUntyped(xt) && !isUntyped(dt) { - assertAssignableTo(x, xt, dt) + err := checkAssignableTo(x, xt, dt) + if err != nil { + if debug { + debug.Printf("checkAssignableTo fail: %v\n", err) + } + panic(fmt.Sprintf("invalid operation: %v (mismatched types %v and %v)", x, xt, dt)) + } } case LSS, LEQ, GTR, GEQ: if checker, ok := binaryChecker[x.Op]; ok { @@ -793,6 +802,9 @@ func (x *BinaryExpr) checkCompatibility(n Node, xt, dt Type, checker func(t Type if !isUntyped(xt) && !isUntyped(dt) { err := checkAssignableTo(n, xt, dt) if err != nil { + if debug { + debug.Printf("checkAssignableTo fail: %v\n", err) + } if swapped { panic(fmt.Sprintf("invalid operation: %v (mismatched types %v and %v)", n, dt, untypedNil(xt))) } else { @@ -850,19 +862,19 @@ func (x *RangeStmt) AssertCompatible(store Store, last BlockNode) { xt := evalStaticTypeOf(store, last, x.X) switch cxt := xt.(type) { case *MapType: - assertAssignableTo(x, cxt.Key, kt) + mustAssignableTo(x, cxt.Key, kt) if vt != nil { - assertAssignableTo(x, cxt.Value, vt) + mustAssignableTo(x, cxt.Value, vt) } case *SliceType: assertIndexTypeIsInt(kt) if vt != nil { - assertAssignableTo(x, cxt.Elt, vt) + mustAssignableTo(x, cxt.Elt, vt) } case *ArrayType: assertIndexTypeIsInt(kt) if vt != nil { - assertAssignableTo(x, cxt.Elt, vt) + mustAssignableTo(x, cxt.Elt, vt) } case PrimitiveType: if cxt.Kind() == StringKind { @@ -902,7 +914,7 @@ func (x *AssignStmt) AssertCompatible(store Store, last BlockNode) { assertValidAssignLhs(store, last, lx) if !isBlankIdentifier(lx) { lxt := evalStaticTypeOf(store, last, lx) - assertAssignableTo(x, cft.Results[i].Type, lxt) + mustAssignableTo(x, cft.Results[i].Type, lxt) } } } @@ -917,7 +929,7 @@ func (x *AssignStmt) AssertCompatible(store Store, last BlockNode) { if !isBlankIdentifier(x.Lhs[0]) { // see composite3.gno dt := evalStaticTypeOf(store, last, x.Lhs[0]) ift := evalStaticTypeOf(store, last, cx) - assertAssignableTo(x, ift, dt) + mustAssignableTo(x, ift, dt) } // check second value assertValidAssignLhs(store, last, x.Lhs[1]) @@ -940,12 +952,12 @@ func (x *AssignStmt) AssertCompatible(store Store, last BlockNode) { if _, ok := cx.X.(*NameExpr); ok { rt := evalStaticTypeOf(store, last, cx.X) if mt, ok := rt.(*MapType); ok { - assertAssignableTo(x, mt.Value, lt) + mustAssignableTo(x, mt.Value, lt) } } else if _, ok := cx.X.(*CompositeLitExpr); ok { cpt := evalStaticTypeOf(store, last, cx.X) if mt, ok := cpt.(*MapType); ok { - assertAssignableTo(x, mt.Value, lt) + mustAssignableTo(x, mt.Value, lt) } else { panic("should not happen") } diff --git a/gnovm/pkg/gnolang/types.go b/gnovm/pkg/gnolang/types.go index f2f57f09235..23ac89b4b22 100644 --- a/gnovm/pkg/gnolang/types.go +++ b/gnovm/pkg/gnolang/types.go @@ -2300,7 +2300,7 @@ func specifyType(store Store, n Node, lookup map[Name]Type, tmpl Type, spec Type generic := ct.Generic[:len(ct.Generic)-len(".Elem()")] match, ok := lookup[generic] if ok { - assertAssignableTo(n, spec, match.Elem()) + mustAssignableTo(n, spec, match.Elem()) return // ok } else { // Panic here, because we don't know whether T @@ -2314,7 +2314,7 @@ func specifyType(store Store, n Node, lookup map[Name]Type, tmpl Type, spec Type } else { match, ok := lookup[ct.Generic] if ok { - assertAssignableTo(n, spec, match) + mustAssignableTo(n, spec, match) return // ok } else { if isUntyped(spec) { diff --git a/gnovm/tests/files/types/cmp_iface_5.gno b/gnovm/tests/files/types/cmp_iface_5.gno index a3875fa57b8..33c3ea80f42 100644 --- a/gnovm/tests/files/types/cmp_iface_5.gno +++ b/gnovm/tests/files/types/cmp_iface_5.gno @@ -24,7 +24,7 @@ func main() { } // Error: -// main/cmp_iface_5.gno:19:5-23: int64 does not implement .uverse.error (missing method Error) +// main/cmp_iface_5.gno:19:5-23: invalid operation: errCmp == (const (1 int64)) (mismatched types int64 and .uverse.error) // TypeCheckError: // main/cmp_iface_5.gno:19:15: invalid operation: errCmp == int64(1) (mismatched types error and int64) diff --git a/gnovm/tests/files/types/cmp_iface_9.gno b/gnovm/tests/files/types/cmp_iface_9.gno new file mode 100644 index 00000000000..8939bb1de96 --- /dev/null +++ b/gnovm/tests/files/types/cmp_iface_9.gno @@ -0,0 +1,32 @@ +package main + +type A interface { + F() +} + +type B interface { + X() + G() +} + +type T struct{} + +func (T) F() {} + +func (T) G() {} + +func (T) X() {} + +func main() { + var a A = T{} + var b B = T{} + + println(b == a) + println(a == b) +} + +// Error: +// main/cmp_iface_9.gno:24:10-16: invalid operation: b == a (mismatched types main.B and main.A) + +// TypeCheckError: +// main/cmp_iface_9.gno:24:15: invalid operation: b == a (mismatched types B and A); main/cmp_iface_9.gno:25:15: invalid operation: a == b (mismatched types A and B) diff --git a/gnovm/tests/files/types/cmp_pointer.gno b/gnovm/tests/files/types/cmp_pointer.gno index d0a924f8c30..d8714db56d6 100644 --- a/gnovm/tests/files/types/cmp_pointer.gno +++ b/gnovm/tests/files/types/cmp_pointer.gno @@ -20,7 +20,7 @@ func main() { } // Error: -// main/cmp_pointer.gno:19:27-38: cannot use main.Person as main.Worker without explicit conversion +// main/cmp_pointer.gno:19:27-38: invalid operation: p1 == p2Ptr (mismatched types *main.Person and *main.Worker) // TypeCheckError: // main/cmp_pointer.gno:19:33: invalid operation: p1 == p2Ptr (mismatched types *Person and *Worker) diff --git a/gnovm/tests/files/types/cmp_slice_4.gno b/gnovm/tests/files/types/cmp_slice_4.gno index 295513ddf97..568218898ca 100644 --- a/gnovm/tests/files/types/cmp_slice_4.gno +++ b/gnovm/tests/files/types/cmp_slice_4.gno @@ -7,7 +7,7 @@ func main() { } // Error: -// main/cmp_slice_4.gno:6:10-23: cannot use int as string +// main/cmp_slice_4.gno:6:10-23: invalid operation: a == expected (mismatched types int and string) // TypeCheckError: // main/cmp_slice_4.gno:6:15: invalid operation: a == expected (mismatched types int and string) diff --git a/gnovm/tests/files/types/cmp_struct_b.gno b/gnovm/tests/files/types/cmp_struct_b.gno index 2ae146ca906..fc9b251a40b 100644 --- a/gnovm/tests/files/types/cmp_struct_b.gno +++ b/gnovm/tests/files/types/cmp_struct_b.gno @@ -16,7 +16,7 @@ func main() { } // Error: -// main/cmp_struct_b.gno:15:10-18: cannot use main.foo as main.bar without explicit conversion +// main/cmp_struct_b.gno:15:10-18: invalid operation: fa == bb (mismatched types main.foo and main.bar) // TypeCheckError: // main/cmp_struct_b.gno:15:16: invalid operation: fa == bb (mismatched types foo and bar) diff --git a/gnovm/tests/files/types/cmp_struct_c1.gno b/gnovm/tests/files/types/cmp_struct_c1.gno index d7bc2bc248a..4d26307b277 100644 --- a/gnovm/tests/files/types/cmp_struct_c1.gno +++ b/gnovm/tests/files/types/cmp_struct_c1.gno @@ -16,7 +16,7 @@ func main() { } // Error: -// main/cmp_struct_c1.gno:15:10-18: cannot use main.bar as main.foo without explicit conversion +// main/cmp_struct_c1.gno:15:10-18: invalid operation: bb == fa (mismatched types main.bar and main.foo) // TypeCheckError: // main/cmp_struct_c1.gno:15:16: invalid operation: bb == fa (mismatched types bar and foo) diff --git a/gnovm/tests/files/types/cmp_struct_g.gno b/gnovm/tests/files/types/cmp_struct_g.gno index 35d993b25ce..c2f8acc70ed 100644 --- a/gnovm/tests/files/types/cmp_struct_g.gno +++ b/gnovm/tests/files/types/cmp_struct_g.gno @@ -18,7 +18,7 @@ func main() { } // Error: -// main/cmp_struct_g.gno:17:25-31: cannot use main.Person as main.Dog without explicit conversion +// main/cmp_struct_g.gno:17:25-31: invalid operation: a == b (mismatched types main.Person and main.Dog) // TypeCheckError: // main/cmp_struct_g.gno:17:30: invalid operation: a == b (mismatched types Person and Dog) diff --git a/gnovm/tests/files/types/eql_0a0.gno b/gnovm/tests/files/types/eql_0a0.gno index 1e679ec01f3..5495518e3cb 100644 --- a/gnovm/tests/files/types/eql_0a0.gno +++ b/gnovm/tests/files/types/eql_0a0.gno @@ -6,7 +6,7 @@ func main() { } // Error: -// main/eql_0a0.gno:5:10-27: cannot use int as int8 +// main/eql_0a0.gno:5:10-27: invalid operation: (const (1 int)) == (const (1 int8)) (mismatched types int and int8) // TypeCheckError: // main/eql_0a0.gno:5:20: invalid operation: int(1) == int8(1) (mismatched types int and int8) diff --git a/gnovm/tests/files/types/eql_0a02.gno b/gnovm/tests/files/types/eql_0a02.gno index fa78f00faac..d66ca7eda15 100644 --- a/gnovm/tests/files/types/eql_0a02.gno +++ b/gnovm/tests/files/types/eql_0a02.gno @@ -8,7 +8,7 @@ func main() { } // Error: -// main/eql_0a02.gno:7:10-21: cannot use *int as string +// main/eql_0a02.gno:7:10-21: invalid operation: intPtr == s (mismatched types *int and string) // TypeCheckError: // main/eql_0a02.gno:7:20: invalid operation: intPtr == s (mismatched types *int and string) diff --git a/gnovm/tests/files/types/eql_0a03.gno b/gnovm/tests/files/types/eql_0a03.gno index 0f514b58cfa..4c1376a0eda 100644 --- a/gnovm/tests/files/types/eql_0a03.gno +++ b/gnovm/tests/files/types/eql_0a03.gno @@ -9,7 +9,7 @@ func main() { } // Error: -// main/eql_0a03.gno:8:10-22: cannot use int8 as int +// main/eql_0a03.gno:8:10-22: invalid operation: intPtr == &(i) (mismatched types *int8 and *int) // TypeCheckError: // main/eql_0a03.gno:8:20: invalid operation: intPtr == &i (mismatched types *int8 and *int) diff --git a/gnovm/tests/files/types/eql_0a1.gno b/gnovm/tests/files/types/eql_0a1.gno index d7b2e8f66a5..14d380bce16 100644 --- a/gnovm/tests/files/types/eql_0a1.gno +++ b/gnovm/tests/files/types/eql_0a1.gno @@ -6,7 +6,7 @@ func main() { } // Error: -// main/eql_0a1.gno:5:10-27: cannot use int as int8 +// main/eql_0a1.gno:5:10-27: invalid operation: (const (1 int)) != (const (1 int8)) (mismatched types int and int8) // TypeCheckError: // main/eql_0a1.gno:5:20: invalid operation: int(1) != int8(1) (mismatched types int and int8) diff --git a/gnovm/tests/files/types/eql_0a1a0.gno b/gnovm/tests/files/types/eql_0a1a0.gno index ebea69b120c..ae99f8a791d 100644 --- a/gnovm/tests/files/types/eql_0a1a0.gno +++ b/gnovm/tests/files/types/eql_0a1a0.gno @@ -6,7 +6,7 @@ func main() { } // Error: -// main/eql_0a1a0.gno:5:10-24: cannot use uint64 as uint +// main/eql_0a1a0.gno:5:10-24: invalid operation: (const (1 uint64)) == a (mismatched types uint64 and uint) // TypeCheckError: // main/eql_0a1a0.gno:5:23: invalid operation: uint64(1) == a (mismatched types uint64 and uint) diff --git a/gnovm/tests/files/types/eql_0a1a1.gno b/gnovm/tests/files/types/eql_0a1a1.gno index 770c4970b89..8793e946ea9 100644 --- a/gnovm/tests/files/types/eql_0a1a1.gno +++ b/gnovm/tests/files/types/eql_0a1a1.gno @@ -6,7 +6,7 @@ func main() { } // Error: -// main/eql_0a1a1.gno:5:10-24: cannot use uint as uint64 +// main/eql_0a1a1.gno:5:10-24: invalid operation: a == (const (1 uint64)) (mismatched types uint and uint64) // TypeCheckError: // main/eql_0a1a1.gno:5:15: invalid operation: a == uint64(1) (mismatched types uint and uint64) diff --git a/gnovm/tests/files/types/eql_0a1f.gno b/gnovm/tests/files/types/eql_0a1f.gno index 8138d120ce3..3f0b745bb9c 100644 --- a/gnovm/tests/files/types/eql_0a1f.gno +++ b/gnovm/tests/files/types/eql_0a1f.gno @@ -7,7 +7,7 @@ func main() { } // Error: -// main/eql_0a1f.gno:6:10-23: cannot use int as string +// main/eql_0a1f.gno:6:10-23: invalid operation: a == expected (mismatched types int and string) // TypeCheckError: // main/eql_0a1f.gno:6:15: invalid operation: a == expected (mismatched types int and string) diff --git a/gnovm/tests/files/types/eql_0a1g.gno b/gnovm/tests/files/types/eql_0a1g.gno index 3233665295b..2b502139f81 100644 --- a/gnovm/tests/files/types/eql_0a1g.gno +++ b/gnovm/tests/files/types/eql_0a1g.gno @@ -7,7 +7,7 @@ func main() { } // Error: -// main/eql_0a1g.gno:6:10-16: cannot use int as float32 +// main/eql_0a1g.gno:6:10-16: invalid operation: a == b (mismatched types int and float32) // TypeCheckError: // main/eql_0a1g.gno:6:15: invalid operation: a == b (mismatched types int and float32) diff --git a/gnovm/tests/files/types/eql_0a2.gno b/gnovm/tests/files/types/eql_0a2.gno index 2f6eefc9847..8104676378a 100644 --- a/gnovm/tests/files/types/eql_0a2.gno +++ b/gnovm/tests/files/types/eql_0a2.gno @@ -22,7 +22,7 @@ func main() { } // Error: -// main/eql_0a2.gno:21:10-32: cannot use main.Error1 as main.Error2 without explicit conversion +// main/eql_0a2.gno:21:10-32: invalid operation: (const (0 main.Error1)) == (const (0 main.Error2)) (mismatched types main.Error1 and main.Error2) // TypeCheckError: // main/eql_0a2.gno:21:23: invalid operation: Error1(0) == Error2(0) (mismatched types Error1 and Error2) diff --git a/gnovm/tests/files/types/eql_0a3.gno b/gnovm/tests/files/types/eql_0a3.gno index f199efe23a6..3ac2b9db449 100644 --- a/gnovm/tests/files/types/eql_0a3.gno +++ b/gnovm/tests/files/types/eql_0a3.gno @@ -22,7 +22,7 @@ func main() { } // Error: -// main/eql_0a3.gno:21:10-32: cannot use main.Error1 as main.Error2 without explicit conversion +// main/eql_0a3.gno:21:10-32: invalid operation: (const (0 main.Error1)) != (const (0 main.Error2)) (mismatched types main.Error1 and main.Error2) // TypeCheckError: // main/eql_0a3.gno:21:23: invalid operation: Error1(0) != Error2(0) (mismatched types Error1 and Error2) diff --git a/gnovm/tests/files/types/eql_0a4.gno b/gnovm/tests/files/types/eql_0a4.gno index 23638255bff..bd80573fd25 100644 --- a/gnovm/tests/files/types/eql_0a4.gno +++ b/gnovm/tests/files/types/eql_0a4.gno @@ -22,7 +22,7 @@ func main() { } // Error: -// main/eql_0a4.gno:21:10-32: cannot use main.Error1 as main.Error2 without explicit conversion +// main/eql_0a4.gno:21:10-32: invalid operation: (const (0 main.Error1)) != (const (0 main.Error2)) (mismatched types main.Error1 and main.Error2) // TypeCheckError: // main/eql_0a4.gno:21:23: invalid operation: Error1(0) != Error2(0) (mismatched types Error1 and Error2) diff --git a/gnovm/tests/files/types/eql_0e0.gno b/gnovm/tests/files/types/eql_0e0.gno index 45189384e56..19b5822f4f4 100644 --- a/gnovm/tests/files/types/eql_0e0.gno +++ b/gnovm/tests/files/types/eql_0e0.gno @@ -24,7 +24,7 @@ func main() { } // Error: -// main/eql_0e0.gno:23:10-18: cannot use main.Error1 as main.Error2 without explicit conversion +// main/eql_0e0.gno:23:10-18: invalid operation: e1 == e2 (mismatched types main.Error1 and main.Error2) // TypeCheckError: // main/eql_0e0.gno:23:16: invalid operation: e1 == e2 (mismatched types Error1 and Error2) diff --git a/gnovm/tests/files/types/eql_0e1.gno b/gnovm/tests/files/types/eql_0e1.gno index 4d356e9b632..6f74f303828 100644 --- a/gnovm/tests/files/types/eql_0e1.gno +++ b/gnovm/tests/files/types/eql_0e1.gno @@ -24,7 +24,7 @@ func main() { } // Error: -// main/eql_0e1.gno:23:10-18: cannot use main.Error1 as main.Error2 without explicit conversion +// main/eql_0e1.gno:23:10-18: invalid operation: e1 != e2 (mismatched types main.Error1 and main.Error2) // TypeCheckError: // main/eql_0e1.gno:23:16: invalid operation: e1 != e2 (mismatched types Error1 and Error2) diff --git a/gnovm/tests/files/types/eql_0f1.gno b/gnovm/tests/files/types/eql_0f1.gno index f9a1342c300..5a8d02b653e 100644 --- a/gnovm/tests/files/types/eql_0f1.gno +++ b/gnovm/tests/files/types/eql_0f1.gno @@ -25,7 +25,7 @@ func main() { } // Error: -// main/eql_0f1.gno:19:5-23: int64 does not implement .uverse.error (missing method Error) +// main/eql_0f1.gno:19:5-23: invalid operation: (const (1 int64)) == errCmp (mismatched types int64 and .uverse.error) // TypeCheckError: // main/eql_0f1.gno:19:17: invalid operation: int64(1) == errCmp (mismatched types int64 and error) diff --git a/gnovm/tests/files/types/eql_0f14.gno b/gnovm/tests/files/types/eql_0f14.gno index c4c508a7521..e5a7c9f7c92 100644 --- a/gnovm/tests/files/types/eql_0f14.gno +++ b/gnovm/tests/files/types/eql_0f14.gno @@ -11,7 +11,7 @@ func main() { } // Error: -// main/eql_0f14.gno:10:10-16: cannot use [2]string as [2]int +// main/eql_0f14.gno:10:10-16: invalid operation: a == c (mismatched types [2]string and [2]int) // TypeCheckError: // main/eql_0f14.gno:10:15: invalid operation: a == c (mismatched types [2]string and [2]int) diff --git a/gnovm/tests/files/types/eql_0f30f.gno b/gnovm/tests/files/types/eql_0f30f.gno index 4950076d315..33cd28e51d1 100644 --- a/gnovm/tests/files/types/eql_0f30f.gno +++ b/gnovm/tests/files/types/eql_0f30f.gno @@ -8,7 +8,7 @@ func main() { } // Error: -// main/eql_0f30f.gno:7:10-16: cannot use [2]int as [3]int +// main/eql_0f30f.gno:7:10-16: invalid operation: a == b (mismatched types [2]int and [3]int) // TypeCheckError: // main/eql_0f30f.gno:7:15: invalid operation: a == b (mismatched types [2]int and [3]int) diff --git a/gnovm/tests/files/types/eql_0f41.gno b/gnovm/tests/files/types/eql_0f41.gno index e244b23af71..c441218fc11 100644 --- a/gnovm/tests/files/types/eql_0f41.gno +++ b/gnovm/tests/files/types/eql_0f41.gno @@ -32,7 +32,7 @@ func main() { } // Error: -// main/eql_0f41.gno:27:5-20: main.animal does not implement .uverse.error (missing method Error) +// main/eql_0f41.gno:27:5-20: invalid operation: get() == errCmp (mismatched types main.animal and .uverse.error) // TypeCheckError: // main/eql_0f41.gno:27:14: invalid operation: get() == errCmp (mismatched types animal and error) diff --git a/gnovm/tests/files/types/eql_0f8.gno b/gnovm/tests/files/types/eql_0f8.gno index 46e0b909ce1..f25984e0b6b 100644 --- a/gnovm/tests/files/types/eql_0f8.gno +++ b/gnovm/tests/files/types/eql_0f8.gno @@ -24,7 +24,7 @@ func main() { } // Error: -// main/eql_0f8.gno:19:5-23: int64 does not implement .uverse.error (missing method Error) +// main/eql_0f8.gno:19:5-23: invalid operation: errCmp == (const (1 int64)) (mismatched types int64 and .uverse.error) // TypeCheckError: // main/eql_0f8.gno:19:15: invalid operation: errCmp == int64(1) (mismatched types error and int64)