type T struct{}
func main() {
- t := T{X: 1, X: 1, X: 1, X: 1, X: 1, X: 1, X: 1, X: 1, X: 1, X: 1} // ERROR "unknown field 'X' in struct literal of type T"
- var s string = 1 // ERROR "cannot use 1"
+ t := T{X: 1, X: 1, X: 1, X: 1, X: 1, X: 1, X: 1, X: 1, X: 1, X: 1} // ERROR "unknown field 'X' in struct literal of type T|unknown field .*X.* in .*T.*"
+ var s string = 1 // ERROR "cannot use 1|incompatible type"
}
import /* // ERROR "import path" */ `
bogus`
-func f(x int /* // ERROR "unexpected newline"
+func f(x int /* // GC_ERROR "unexpected newline"
-*/)
+*/) // GCCGO_ERROR "expected .*\).*|expected declaration"
package p
-var x any // ERROR "undefined: any"
+var x any // ERROR "undefined: any|undefined type .*any.*"
import "unsafe"
-type s struct { unsafe.Pointer } // ERROR "embedded type cannot be a pointer"
+type s struct { unsafe.Pointer } // ERROR "embedded type cannot be a pointer|embedded type may not be a pointer"
type s1 struct { p unsafe.Pointer }
import "./a"
import "./b"
-var _ a.A = b.B() // ERROR "cannot use b\.B"
+var _ a.A = b.B() // ERROR "cannot use b\.B|incompatible type"
func f(e interface{}) {
switch e.(type) {
- case nil, nil: // ERROR "multiple nil cases in type switch"
+ case nil, nil: // ERROR "multiple nil cases in type switch|duplicate type in switch"
}
switch e.(type) {
case nil:
- case nil: // ERROR "multiple nil cases in type switch"
+ case nil: // ERROR "multiple nil cases in type switch|duplicate type in switch"
}
}
package p
var a []int = []int{1: 1}
-var b []int = []int{-1: 1} // ERROR "must be non-negative integer constant"
+var b []int = []int{-1: 1} // ERROR "must be non-negative integer constant|index expression is negative"
var c []int = []int{2.0: 2}
-var d []int = []int{-2.0: 2} // ERROR "must be non-negative integer constant"
+var d []int = []int{-2.0: 2} // ERROR "must be non-negative integer constant|index expression is negative"
var e []int = []int{3 + 0i: 3}
-var f []int = []int{3i: 3} // ERROR "truncated to integer"
+var f []int = []int{3i: 3} // ERROR "truncated to integer|index expression is not integer constant"
-var g []int = []int{"a": 4} // ERROR "must be non-negative integer constant"
+var g []int = []int{"a": 4} // ERROR "must be non-negative integer constant|index expression is not integer constant"
func main() {
i := 0
- for ; ; i++) { // ERROR "unexpected \), expecting { after for clause"
+ for ; ; i++) { // ERROR "unexpected \), expecting { after for clause|expected .*{.*|expected .*;.*"
}
-}
+} // GCCGO_ERROR "expected declaration"
package p
-type F func(b T) // ERROR "T is not a type"
+type F func(b T) // ERROR "T is not a type|expected type"
func T(fn F) {
func() {
expect map[string]int
}{
about: "this one",
- updates: map[string]int{"gopher": 10}, // ERROR "unknown field 'updates' in struct literal of type"
+ updates: map[string]int{"gopher": 10}, // ERROR "unknown field 'updates' in struct literal of type|unknown field .*updates.* in .*unnamed struct.*"
}
}
func main() {
var s []int
- var _ string = append(s, Foo{""}) // ERROR "cannot use .. \(type untyped string\) as type int in field value" "cannot use Foo{...} \(type Foo\) as type int in append" "cannot use append\(s\, Foo{...}\) \(type \[\]int\) as type string in assignment"
+ var _ string = append(s, Foo{""}) // ERROR "cannot use .. \(type untyped string\) as type int in field value|incompatible type" "cannot use Foo{...} \(type Foo\) as type int in append" "cannot use append\(s\, Foo{...}\) \(type \[\]int\) as type string in assignment"
}
_ = func() {}
}
-func foo() { // ERROR "foo redeclared in this block"
+func foo() { // ERROR "foo redeclared in this block|redefinition of .*foo.*"
_ = func() {}
}
var ch chan bool
select {
default:
- case <-ch { // don't crash here
- } // ERROR "expecting :"
+ case <-ch { // GCCGO_ERROR "expected colon"
+ } // GC_ERROR "expecting :"
}
}
var _ = T{
- f: { // ERROR "missing type in composite literal"
+ f: { // ERROR "missing type in composite literal|may only omit types within"
"a": "b",
},
}
-// ERROR "syntax error: unexpected newline, expecting type"
+// ERROR "syntax error: unexpected newline, expecting type|expected type"
import "./other"
func InMyCode(e *other.Exported) {
- e.member() // ERROR "e\.member undefined .cannot refer to unexported field or method other\.\(\*Exported\)\.member."
+ e.member() // ERROR "e\.member undefined .cannot refer to unexported field or method other\.\(\*Exported\)\.member.|unexported field or method"
}
func main() {}
type B = T
func (T) m() {}
-func (T) m() {} // ERROR "redeclared"
-func (A) m() {} // ERROR "redeclared"
-func (A) m() {} // ERROR "redeclared"
-func (B) m() {} // ERROR "redeclared"
-func (B) m() {} // ERROR "redeclared"
+func (T) m() {} // ERROR "redeclared|redefinition"
+func (A) m() {} // ERROR "redeclared|redefinition"
+func (A) m() {} // ERROR "redeclared|redefinition"
+func (B) m() {} // ERROR "redeclared|redefinition"
+func (B) m() {} // ERROR "redeclared|redefinition"
-func (*T) m() {} // ERROR "redeclared"
-func (*A) m() {} // ERROR "redeclared"
-func (*B) m() {} // ERROR "redeclared"
+func (*T) m() {} // ERROR "redeclared|redefinition"
+func (*A) m() {} // ERROR "redeclared|redefinition"
+func (*B) m() {} // ERROR "redeclared|redefinition"
package p
func _() {
- if a := 10 { // ERROR "cannot use a := 10 as value"
+ if a := 10 { // ERROR "cannot use a := 10 as value|expected .*;|declared but not used"
}
- for b := 10 { // ERROR "cannot use b := 10 as value"
+ for b := 10 { // ERROR "cannot use b := 10 as value|parse error|declared but not used"
}
- switch c := 10 { // ERROR "cannot use c := 10 as value"
+ switch c := 10 { // ERROR "cannot use c := 10 as value|expected .*;|declared but not used"
}
}
func f(x int, y uint) {
if true {
- return "a" > 10 // ERROR "^too many arguments to return$" "."
+ return "a" > 10 // ERROR "^too many arguments to return$|return with value in function with no return|mismatched types"
}
- return "gopher" == true, 10 // ERROR "^too many arguments to return$" "."
+ return "gopher" == true, 10 // ERROR "^too many arguments to return$|return with value in function with no return|mismatched types"
}
func main() {
- f(2, 3 < "x", 10) // ERROR "^too many arguments in call to f$" "."
+ f(2, 3 < "x", 10) // ERROR "too many arguments|invalid operation|incompatible type"
- f(10, 10, "a") // ERROR "too many arguments in call to f\n\thave \(number, number, string\)\n\twant \(int, uint\)"
+ f(10, 10, "a") // ERROR "too many arguments"
}
package p
-var _ = ... . // ERROR "unexpected ..."
+var _ = ... . // ERROR "unexpected ...|expected operand|expected .*;"
var (
y = T{"stare"}
- w = T{_: "look"} // ERROR "invalid field name _ in struct initializer"
+ w = T{_: "look"} // ERROR "invalid field name _ in struct initializer|expected struct field name"
_ = T{"page"}
- _ = T{_: "out"} // ERROR "invalid field name _ in struct initializer"
+ _ = T{_: "out"} // ERROR "invalid field name _ in struct initializer|expected struct field name"
)
func bad() {
- var z = T{_: "verse"} // ERROR "invalid field name _ in struct initializer"
+ var z = T{_: "verse"} // ERROR "invalid field name _ in struct initializer|expected struct field name"
_ = z
- _ = T{_: "itinerary"} // ERROR "invalid field name _ in struct initializer"
+ _ = T{_: "itinerary"} // ERROR "invalid field name _ in struct initializer|expected struct field name"
}
package p
func f() {
- if err := http.ListenAndServe(
-} // ERROR "unexpected }, expecting expression"
+ if err := http.ListenAndServe( // GCCGO_ERROR "undefined name"
+} // ERROR "unexpected }, expecting expression|expected operand|missing .*\)|expected .*;|expected .*{"