1
0
mirror of https://github.com/golang/go synced 2024-11-25 04:07:55 -07:00

test: match gccgo error messages

bug340.go:14:7: error: expected type
bug340.go:15:4: error: reference to undefined field or method ‘x’

bug350.go:12:1: error: redefinition of ‘m’
bug350.go:11:1: note: previous definition of ‘m’ was here
bug350.go:15:1: error: redefinition of ‘p’
bug350.go:14:1: note: previous definition of ‘p’ was here

bug351.go:12:6: error: non-name on left side of ‘:=’

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5127041
This commit is contained in:
Ian Lance Taylor 2011-09-23 21:23:40 -07:00
parent 10b23e7fc9
commit 8a06936ea1
3 changed files with 8 additions and 8 deletions

View File

@ -10,8 +10,8 @@ package main
func main() { func main() {
var x interface{} var x interface{}
switch t := x.(type) { // ERROR "0 is not a type" switch t := x.(type) { // GC_ERROR "0 is not a type"
case 0: case 0: // GCCGO_ERROR "expected type"
t.x = 1 // ERROR "type interface \{ \}" t.x = 1 // ERROR "type interface \{ \}|reference to undefined field or method"
} }
} }

View File

@ -8,8 +8,8 @@ package main
type T int type T int
func (T) m() {} func (T) m() {} // GCCGO_ERROR "previous"
func (T) m() {} // ERROR "T[.]m redeclared" func (T) m() {} // ERROR "T[.]m redeclared|redefinition"
func (*T) p() {} func (*T) p() {} // GCCGO_ERROR "previous"
func (*T) p() {} // ERROR "[(][*]T[)][.]p redeclared" func (*T) p() {} // ERROR "[(][*]T[)][.]p redeclared|redefinition"

View File

@ -9,5 +9,5 @@ package main
var x int var x int
func main() { func main() {
(x) := 0 // ERROR "non-name [(]x[)]" (x) := 0 // ERROR "non-name [(]x[)]|non-name on left side"
} }