close(c)
close(cs)
close(cr) // ERROR "receive"
- close(n) // ERROR "invalid operation.*non-chan type"
+ close(n) // ERROR "invalid operation.*non-chan type|not a channel"
}
package main
func f (x, // GCCGO_ERROR "previous"
- x int) { // ERROR "duplicate argument|redefinition"
+ x int) { // ERROR "duplicate argument|redefinition|redeclared"
}
func main() {
var s string = nil; // ERROR "illegal|invalid|incompatible|cannot"
+ _ = s
}
package main
-const x x = 2 // ERROR "loop|type"
+const x x = 2 // ERROR "loop|type|cycle"
/*
bug081.go:3: first constant must evaluate an expression
const h float64 = 3.14;
i = h; // ERROR "convert|incompatible|cannot"
- i = int(h); // ERROR "truncate"
+ i = int(h); // ERROR "truncate|cannot convert"
}
func main() {
// should allow at most 2 sizes
- a := make([]int, 10, 20, 30, 40); // ERROR "too many"
+ a := make([]int, 10, 20, 30, 40); // ERROR "too many|expects 2 or 3 arguments; found 5"
}
func main() {
const a uint64 = 10;
var b int64 = a; // ERROR "convert|cannot|incompatible"
+ _ = b
}
package main
type T struct {
- x, x int // ERROR "duplicate"
+ x, x int // ERROR "duplicate|redeclared"
}
package main
var (
- a, b = f() // ERROR "initialization loop|depends upon itself"
+ a, b = f() // ERROR "initialization loop|depends upon itself|initialization cycle"
c = b
)
func f() (int, bool) { return 0, true }
func main() {
- x, y := f(), 2; // ERROR "multi"
+ x, y := f(), 2; // ERROR "multi|2-valued"
_, _ = x, y
}
var m map[string]int;
func main() {
- println(t["hi"]); // ERROR "non-integer slice index|must be integer"
- println(s["hi"]); // ERROR "non-integer string index|must be integer"
- println(m[0]); // ERROR "cannot use.*as type string"
+ println(t["hi"]); // ERROR "non-integer slice index|must be integer|cannot convert"
+ println(s["hi"]); // ERROR "non-integer string index|must be integer|cannot convert"
+ println(m[0]); // ERROR "cannot use.*as type string|cannot convert"
}
package main
-type A struct { a A } // ERROR "recursive"
+type A struct { a A } // ERROR "recursive|cycle"
func foo() { new(A).bar() }
func (a A) bar() {}
}
}
-var m = map[string]F{"f": f} // ERROR "initialization loop|depends upon itself"
+var m = map[string]F{"f": f} // ERROR "initialization loop|depends upon itself|initialization cycle"
package main
-type T T // ERROR "recursive"
+type T T // ERROR "recursive|cycle"
package main
-type A [...]int // ERROR "outside of array literal"
+type A [...]int // ERROR "outside of array literal|invalid use of \[\.\.\.\]"
package main
func f1() {
- a, b := f() // ERROR "assignment mismatch|does not match"
+ a, b := f() // ERROR "assignment mismatch|does not match|cannot initialize"
_ = a
_ = b
}
func f2() {
var a, b int
- a, b = f() // ERROR "assignment mismatch|does not match"
+ a, b = f() // ERROR "assignment mismatch|does not match|cannot assign"
_ = a
_ = b
}
check("t.M()", t.M())
check("pt.M()", pt.M())
check("ti.M()", ti.M())
- check("pti.M()", pti.M()) // ERROR "pointer to interface, not interface"
+ check("pti.M()", pti.M()) // ERROR "pointer to interface, not interface|no field or method M"
check("s.M()", s.M())
check("ps.M()", ps.M())
i = t
check("i = t; i.M()", i.M())
- check("i = t; pi.M()", pi.M()) // ERROR "pointer to interface, not interface"
+ check("i = t; pi.M()", pi.M()) // ERROR "pointer to interface, not interface|no field or method M"
i = pt
check("i = pt; i.M()", i.M())
- check("i = pt; pi.M()", pi.M()) // ERROR "pointer to interface, not interface"
+ check("i = pt; pi.M()", pi.M()) // ERROR "pointer to interface, not interface|no field or method M"
i = s
check("i = s; i.M()", i.M())
- check("i = s; pi.M()", pi.M()) // ERROR "pointer to interface, not interface"
+ check("i = s; pi.M()", pi.M()) // ERROR "pointer to interface, not interface|no field or method M"
i = ps
check("i = ps; i.M()", i.M())
- check("i = ps; pi.M()", pi.M()) // ERROR "pointer to interface, not interface"
+ check("i = ps; pi.M()", pi.M()) // ERROR "pointer to interface, not interface|no field or method M"
if !ok {
println("BUG: interface10")
func main() {
e = t // ok
- t = e // ERROR "need explicit|need type assertion"
+ t = e // ERROR "need explicit|need type assertion|incompatible type"
// neither of these can work,
// because i has an extra method
t = i // ERROR "incompatible|assignment$"
i = i2 // ok
- i2 = i // ERROR "incompatible|missing N method"
+ i2 = i // ERROR "incompatible|missing N method|cannot convert"
i = I(i2) // ok
- i2 = I2(i) // ERROR "invalid|missing N method"
+ i2 = I2(i) // ERROR "invalid|missing N method|cannot convert"
e = E(t) // ok
- t = T(e) // ERROR "need explicit|need type assertion|incompatible"
+ t = T(e) // ERROR "need explicit|need type assertion|incompatible|cannot convert"
// cannot type-assert non-interfaces
f := 2.0
- _ = f.(int) // ERROR "non-interface type"
+ _ = f.(int) // ERROR "non-interface type|not an interface type"
}
var m1 M = ii // ERROR "incompatible|missing"
var m2 M = jj // ERROR "incompatible|wrong type for M method"
-var m3 = M(ii) // ERROR "invalid|missing"
-var m4 = M(jj) // ERROR "invalid|wrong type for M method"
+var m3 = M(ii) // ERROR "invalid|missing|cannot convert"
+var m4 = M(jj) // ERROR "invalid|wrong type for M method|cannot convert"
type B1 interface {
_() // ERROR "methods must have a unique non-blank name"
func (t *T2) _() {}
// Check that nothing satisfies an interface with blank methods.
-var b1 B1 = &T2{} // ERROR "incompatible|missing _ method"
-var b2 B2 = &T2{} // ERROR "incompatible|missing _ method"
+// Disabled this test as it's not clear we need this behavior.
+// See also issue #42964.
+/*
+var b1 B1 = &T2{} // "incompatible|missing _ method"
+var b2 B2 = &T2{} // "incompatible|missing _ method"
+*/
\ No newline at end of file
func main() {
print("call addinst\n")
- var x Inst = AddInst(new(Start)) // ERROR "pointer to interface"
+ var x Inst = AddInst(new(Start)) // ERROR "pointer to interface|incompatible type"
+ _ = x
print("return from addinst\n")
var y *Inst = new(Start) // ERROR "pointer to interface|incompatible type"
+ _ = y
}
var sp SP
v = t
- p = t // ERROR "does not implement|requires a pointer"
+ p = t // ERROR "does not implement|requires a pointer|cannot use"
_, _ = v, p
v = &t
p = &t
_, _ = v, p
v = s
- p = s // ERROR "does not implement|requires a pointer"
+ p = s // ERROR "does not implement|requires a pointer|cannot use"
_, _ = v, p
v = &s
p = &s
"wb",
"append",
"slice",
+ "typeassert",
"ssa/check_bce/debug",
"ssa/intrinsics/debug",
"ssa/prove/debug",