]> Cypherpunks repositories - gostls13.git/commitdiff
test: match gofrontend error messages
authorIan Lance Taylor <iant@golang.org>
Sat, 12 Dec 2020 03:53:32 +0000 (19:53 -0800)
committerIan Lance Taylor <iant@golang.org>
Mon, 14 Dec 2020 17:26:06 +0000 (17:26 +0000)
fixedbugs/issue14136.go:17:16: error: unknown field ‘X’ in ‘T’
fixedbugs/issue14136.go:18:13: error: incompatible type in initialization (cannot use type int as type string)

fixedbugs/issue14520.go:9:37: error: import path contains control character
fixedbugs/issue14520.go:14:2: error: expected ‘)’
fixedbugs/issue14520.go:14:3: error: expected declaration

fixedbugs/issue14652.go:9:7: error: use of undefined type ‘any’

fixedbugs/issue14729.go:13:17: error: embedded type may not be a pointer

fixedbugs/issue15514.dir/c.go:10: error: incompatible type in initialization

fixedbugs/issue15898.go:11:9: error: duplicate type in switch
fixedbugs/issue15898.go:16:9: error: duplicate type in switch

fixedbugs/issue16439.go:10:21: error: index expression is negative
fixedbugs/issue16439.go:13:21: error: index expression is negative
fixedbugs/issue16439.go:16:21: error: index expression is not integer constant
fixedbugs/issue16439.go:18:22: error: index expression is not integer constant

fixedbugs/issue17328.go:11:20: error: expected ‘{’
fixedbugs/issue17328.go:11:20: error: expected ‘;’ or ‘}’ or newline
fixedbugs/issue17328.go:13:1: error: expected declaration

fixedbugs/issue17588.go:14:15: error: expected type

fixedbugs/issue17631.go:20:17: error: unknown field ‘updates’ in ‘unnamed struct’

fixedbugs/issue17645.go:15:13: error: incompatible type in initialization

fixedbugs/issue17758.go:13:1: error: redefinition of ‘foo’
fixedbugs/issue17758.go:9:1: note: previous definition of ‘foo’ was here

fixedbugs/issue18092.go:13:19: error: expected colon

fixedbugs/issue18231.go:17:12: error: may only omit types within composite literals of slice, array, or map type

fixedbugs/issue18393.go:24:38: error: expected type

fixedbugs/issue18419.dir/test.go:12: error: reference to unexported field or method 'member'

fixedbugs/issue18655.go:14:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:15:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:16:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:17:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:18:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:20:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:21:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:22:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here

fixedbugs/issue18915.go:13:20: error: expected ‘;’ after statement in if expression
fixedbugs/issue18915.go:16:21: error: parse error in for statement
fixedbugs/issue18915.go:19:24: error: expected ‘;’ after statement in switch expression
fixedbugs/issue18915.go:13:12: error: ‘a’ declared but not used
fixedbugs/issue18915.go:16:13: error: ‘b’ declared but not used
fixedbugs/issue18915.go:19:16: error: ‘c’ declared but not used

fixedbugs/issue19012.go:16:17: error: return with value in function with no return type
fixedbugs/issue19012.go:18:9: error: return with value in function with no return type
fixedbugs/issue19012.go:22:16: error: argument 2 has incompatible type (cannot use type bool as type uint)
fixedbugs/issue19012.go:22:9: error: too many arguments
fixedbugs/issue19012.go:22:16: error: incompatible types in binary expression
fixedbugs/issue19012.go:24:9: error: too many arguments

fixedbugs/issue19056.go:9:9: error: expected operand
fixedbugs/issue19056.go:9:9: error: expected ‘;’ or newline after top level declaration

fixedbugs/issue19482.go:25:15: error: expected struct field name
fixedbugs/issue19482.go:27:15: error: expected struct field name
fixedbugs/issue19482.go:31:19: error: expected struct field name
fixedbugs/issue19482.go:33:15: error: expected struct field name

fixedbugs/issue19667.go:13:1: error: expected operand
fixedbugs/issue19667.go:13:1: error: missing ‘)’
fixedbugs/issue19667.go:13:105: error: expected ‘;’ after statement in if expression
fixedbugs/issue19667.go:13:105: error: expected ‘{’
fixedbugs/issue19667.go:12:19: error: reference to undefined name ‘http’

Change-Id: Ia9c75b9c78671f354f0a0623dbc075157ef8f181
Reviewed-on: https://go-review.googlesource.com/c/go/+/277433
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
22 files changed:
test/fixedbugs/issue14136.go
test/fixedbugs/issue14520.go
test/fixedbugs/issue14652.go
test/fixedbugs/issue14729.go
test/fixedbugs/issue15514.dir/c.go
test/fixedbugs/issue15898.go
test/fixedbugs/issue16439.go
test/fixedbugs/issue17328.go
test/fixedbugs/issue17588.go
test/fixedbugs/issue17631.go
test/fixedbugs/issue17645.go
test/fixedbugs/issue17758.go
test/fixedbugs/issue18092.go
test/fixedbugs/issue18231.go
test/fixedbugs/issue18393.go
test/fixedbugs/issue18419.dir/test.go
test/fixedbugs/issue18655.go
test/fixedbugs/issue18915.go
test/fixedbugs/issue19012.go
test/fixedbugs/issue19056.go
test/fixedbugs/issue19482.go
test/fixedbugs/issue19667.go

index f9efd05f96c8cbb904305cd007ed08d6c73102b7..38308cd75c94e298412de4f87a3095d4c49b3032 100644 (file)
@@ -14,6 +14,6 @@ package main
 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"
 }
index 84d240faf0a14981e5182c139fed80f7e7a56fef..0b840ff4bee9ad173cfaf8f23f046630a27e1d56 100644 (file)
@@ -9,6 +9,6 @@ package f
 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"
index b030aee16fc1d9b679f26ae1621901e913b846d3..d53b412668314822423427c98711bb0731041b83 100644 (file)
@@ -6,4 +6,4 @@
 
 package p
 
-var x any // ERROR "undefined: any"
+var x any // ERROR "undefined: any|undefined type .*any.*"
index 88e01f9e16c32ae65254e469a2d8426b26d1b828..9b30fd271505b58c06bd56a58f001fe06ecc9c14 100644 (file)
@@ -10,5 +10,5 @@ package main
 
 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 }
index 11624f925696d144b6887d6158c060c120d16461..dc2ef5bed526db568bc7b151768c1f9f3f2ffbfe 100644 (file)
@@ -7,4 +7,4 @@ package c
 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"
index 7b66ea23dc69306b1b157706558293b3eeb3fbb2..94369f93450f29b46d36da42b8adf53f4fe557c6 100644 (file)
@@ -8,11 +8,11 @@ package p
 
 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"
        }
 }
index f9382bafcd907e55c3e4fc2edd5f37eaa6952ae7..704b6b15a61aac9b2f984a034ef37bf21391bd29 100644 (file)
@@ -7,12 +7,12 @@
 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"
index abe4daa35339ad7bbf39dd05d4d12224175cd919..ef60edbd426dd61ae7c08671954690d77bb078f9 100644 (file)
@@ -8,6 +8,6 @@ package main
 
 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"
index 1be57c62923003bb1d7d2cd70b48232627a371ad..0e3a14ef7c4faa6a398a6d4f598bd762e068a3d9 100644 (file)
@@ -11,7 +11,7 @@
 
 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() {
index 79b7e8a75135223fe873f74ecb9ae6cb6f63fe03..b820b2d5a7508c83f04c29dad86fa553e818e6fb 100644 (file)
@@ -17,6 +17,6 @@ func main() {
                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.*"
        }
 }
index 95fcecd1e0507a2311caafbd492e66457b1e4067..bb34e4ee97a3bfd5db2cad3439ce3ef375c4a257 100644 (file)
@@ -12,5 +12,5 @@ type Foo 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"
 }
index e7f2f3af91506ff18aa2d49b0807d4abc020a4be..8e40f9db7339a910e41970a97697336bec5b97fe 100644 (file)
@@ -10,7 +10,7 @@ func foo() {
        _ = func() {}
 }
 
-func foo() { // ERROR "foo redeclared in this block"
+func foo() { // ERROR "foo redeclared in this block|redefinition of .*foo.*"
        _ = func() {}
 }
 
index 94fd2dd383753dcee8c06f948bc2059a227b4adb..a0f7eddda5a773b56e4af0c58bd29aa732f7c29c 100644 (file)
@@ -10,6 +10,6 @@ func _() {
        var ch chan bool
        select {
        default:
-       case <-ch { // don't crash here
-       }           // ERROR "expecting :"
+       case <-ch { // GCCGO_ERROR "expected colon"
+       }           // GC_ERROR "expecting :"
 }
index adfd2277ffe2ec25500e27365e8e83008d4278b9..774730405263eefa9f3182225e8ea038f44dcb10 100644 (file)
@@ -14,7 +14,7 @@ type T struct {
 }
 
 var _ = T{
-       f: {                // ERROR "missing type in composite literal"
+       f: {                // ERROR "missing type in composite literal|may only omit types within"
                "a": "b",
        },
 }
index c16ff4df97b9effb48a0f30a9502d07e7b672f5c..454392721f08ca69d39e52cb47a8c5667d94488c 100644 (file)
@@ -21,4 +21,4 @@ var x     // error on line 24, not 30
 
 
 
-// ERROR "syntax error: unexpected newline, expecting type"
+// ERROR "syntax error: unexpected newline, expecting type|expected type"
index 31c6025e3f55f467eed7a49a2c0cabfc9893c1ca..da9639dd72e30d930f4dcf5fad37ee036afd2b56 100644 (file)
@@ -9,7 +9,7 @@ package main
 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() {}
index abc26002804d957f71977e27a516876024591fa2..13762f1a94b9e666d1fc66dade33d244d856f2c2 100644 (file)
@@ -11,12 +11,12 @@ type A = T
 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"
index 66e31e2556edfa299a8ed8816024af3ab953f811..22f97c6b62b8ec2dd393319478190ff61844da72 100644 (file)
 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"
        }
 }
index 636bf06e7548a28b5b69a915e229d1b1fe2e657b..158618aa27efcca31f0d4af81c55451cf84936a8 100644 (file)
@@ -13,13 +13,13 @@ package main
 
 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"
 }
index e4e8d07905a31a3eeb6077e9df6becd75d86c5a7..d279eaa3cf64bf0a77f740d4551320e31b694e3f 100644 (file)
@@ -6,4 +6,4 @@
 
 package p
 
-var _ = ... . // ERROR "unexpected ..."
+var _ = ... . // ERROR "unexpected ...|expected operand|expected .*;"
index 97497a434c384d5137a2aaf0c2ae0af704f5e133..4c2c19ec9d9d4ce63457c29b07b559c236305daf 100644 (file)
@@ -22,13 +22,13 @@ func ok() {
 
 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"
 }
index c94a11d87129d6ccd738ec97d00b37639f4cc5a3..e33e35048752dfb4f4c3110e4fba31791e822d98 100644 (file)
@@ -9,5 +9,5 @@
 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 .*{"