mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:08 +00:00
test: match gccgo error messages
R=iant, golang-dev CC=golang-dev https://golang.org/cl/10365052
This commit is contained in:
parent
2f70ac19d2
commit
004dd3d742
7 changed files with 11 additions and 11 deletions
|
@ -11,8 +11,8 @@ var s string;
|
|||
var m map[string]int;
|
||||
|
||||
func main() {
|
||||
println(t["hi"]); // ERROR "non-integer slice index"
|
||||
println(s["hi"]); // ERROR "non-integer string index"
|
||||
println(m[0]); // ERROR "as type string in map index"
|
||||
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"
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
package flag
|
||||
|
||||
var commandLine = NewFlagSet() // ERROR "loop"
|
||||
var commandLine = NewFlagSet() // ERROR "loop|depends upon itself"
|
||||
|
||||
type FlagSet struct {
|
||||
}
|
||||
|
|
|
@ -8,5 +8,5 @@ package foo
|
|||
|
||||
var i int
|
||||
|
||||
func (*i) bar() // ERROR "not a type"
|
||||
func (*i) bar() // ERROR "not a type|expected type"
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ package foo
|
|||
|
||||
var _ = map[string]string{
|
||||
"1": "2",
|
||||
"3", "4", // ERROR "missing key"
|
||||
"3", "4", // ERROR "missing key|must have keys"
|
||||
}
|
||||
|
||||
var _ = []string{
|
||||
"foo",
|
||||
"bar",
|
||||
20, // ERROR "cannot use"
|
||||
20, // ERROR "cannot use|incompatible type"
|
||||
}
|
||||
|
||||
|
|
|
@ -7,5 +7,5 @@
|
|||
package foo
|
||||
|
||||
var s [][10]int
|
||||
const m = len(s[len(s)-1]) // ERROR "is not a constant"
|
||||
const m = len(s[len(s)-1]) // ERROR "is not a constant|is not constant"
|
||||
|
||||
|
|
|
@ -16,5 +16,5 @@ func (T) foo() {}
|
|||
func main() {
|
||||
av := T{}
|
||||
pav := &av
|
||||
(**T).foo(&pav) // ERROR "no method foo"
|
||||
(**T).foo(&pav) // ERROR "no method foo|requires named type or pointer to named"
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import "fmt"
|
|||
|
||||
func main() {
|
||||
var s uint
|
||||
fmt.Println(1.0 + 1<<s) // ERROR "invalid operation"
|
||||
x := 1.0 + 1<<s // ERROR "invalid operation"
|
||||
fmt.Println(1.0 + 1<<s) // ERROR "invalid operation|non-integer type"
|
||||
x := 1.0 + 1<<s // ERROR "invalid operation|non-integer type"
|
||||
_ = x
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue