_ int
}
-func (x int) _() { // ERROR "cannot define new methods on non-local type"
+func (x int) _() { // ERROR "methods on non-local type"
println(x)
}
cs = cr // ERROR "illegal types|incompatible|cannot"
var n int
- <-n // ERROR "receive from non-chan"
- n <- 2 // ERROR "send to non-chan"
+ <-n // ERROR "receive from non-chan|expected channel"
+ n <- 2 // ERROR "send to non-chan|must be channel"
c <- 0 // ok
<-c // ok
close(c)
close(cs)
close(cr) // ERROR "receive"
- close(n) // ERROR "invalid operation.*non-chan type"
+ close(n) // ERROR "invalid operation.*non-chan type|must be channel"
}
_ = m[0][:] // ERROR "slice of unaddressable value"
_ = f()[:] // ERROR "slice of unaddressable value"
- _ = 301[:] // ERROR "cannot slice"
- _ = 3.1[:] // ERROR "cannot slice"
- _ = true[:] // ERROR "cannot slice"
+ _ = 301[:] // ERROR "cannot slice|attempt to slice object that is not"
+ _ = 3.1[:] // ERROR "cannot slice|attempt to slice object that is not"
+ _ = true[:] // ERROR "cannot slice|attempt to slice object that is not"
// these are okay because they are slicing a pointer to an array
_ = (&[3]int{1, 2, 3})[:]
_ = &T{0, 0, "", nil} // ok
_ = &T{i: 0, f: 0, s: "", next: {}} // ERROR "missing type in composite literal|omit types within composite literal"
_ = &T{0, 0, "", {}} // ERROR "missing type in composite literal|omit types within composite literal"
- _ = TP{i: 0, f: 0, s: "", next: {}} // ERROR "invalid composite literal type TP"
- _ = &Ti{} // ERROR "invalid composite literal type Ti"
+ _ = TP{i: 0, f: 0, s: "", next: {}} // ERROR "invalid composite literal type TP|omit types within composite literal"
+ _ = &Ti{} // ERROR "invalid composite literal type Ti|expected.*type for composite literal"
)
type M map[T]T
var x7 = float32(1e1000) // ERROR "overflow"
// unsafe.Pointer can only convert to/from uintptr
-var _ = string(unsafe.Pointer(uintptr(65))) // ERROR "convert"
-var _ = float64(unsafe.Pointer(uintptr(65))) // ERROR "convert"
-var _ = int(unsafe.Pointer(uintptr(65))) // ERROR "convert"
+var _ = string(unsafe.Pointer(uintptr(65))) // ERROR "convert|conversion"
+var _ = float64(unsafe.Pointer(uintptr(65))) // ERROR "convert|conversion"
+var _ = int(unsafe.Pointer(uintptr(65))) // ERROR "convert|conversion"
// implicit conversions merit scrutiny
var s string
_ = [...]byte("foo") // ERROR "[.][.][.]"
_ = [...][...]int{{1,2,3},{4,5,6}} // ERROR "[.][.][.]"
- Foo(x...) // ERROR "invalid use of [.][.][.] in call"
+ Foo(x...) // ERROR "invalid use of .*[.][.][.]"
}
var x int
var a = []int{ x: 1} // ERROR "constant"
-var b = [...]int{x: 1}
+var b = [...]int{x: 1} // GCCGO_ERROR "constant"
var c = map[int]int{ x: 1}
// important: no newline on end of next line.
// 6g used to print <epoch> instead of bug332.go:111
-func (t *T) F() {} // ERROR "undefined: T"
\ No newline at end of file
+func (t *T) F() {} // ERROR "undefined.*T"
\ No newline at end of file
_ = a[10:10]
_ = a[9:12] // ERROR "invalid slice index 12|index out of bounds"
_ = a[11:12] // ERROR "invalid slice index 11|index out of bounds"
- _ = a[1<<100 : 1<<110] // ERROR "overflows int" "invalid slice index 1 << 100|index out of bounds"
+ _ = a[1<<100 : 1<<110] // ERROR "overflows int|integer constant overflow" "invalid slice index 1 << 100|index out of bounds"
var s []int
_ = s[-1] // ERROR "invalid slice index -1|index out of bounds"
_ = s[10:10]
_ = s[9:12]
_ = s[11:12]
- _ = s[1<<100 : 1<<110] // ERROR "overflows int" "invalid slice index 1 << 100|index out of bounds"
+ _ = s[1<<100 : 1<<110] // ERROR "overflows int|integer constant overflow" "invalid slice index 1 << 100|index out of bounds"
const c = "foofoofoof"
_ = c[-1] // ERROR "invalid string index -1|index out of bounds"
_ = c[10:10]
_ = c[9:12] // ERROR "invalid slice index 12|index out of bounds"
_ = c[11:12] // ERROR "invalid slice index 11|index out of bounds"
- _ = c[1<<100 : 1<<110] // ERROR "overflows int" "invalid slice index 1 << 100|index out of bounds"
+ _ = c[1<<100 : 1<<110] // ERROR "overflows int|integer constant overflow" "invalid slice index 1 << 100|index out of bounds"
var t string
_ = t[-1] // ERROR "invalid string index -1|index out of bounds"
_ = t[10:10]
_ = t[9:12]
_ = t[11:12]
- _ = t[1<<100 : 1<<110] // ERROR "overflows int" "invalid slice index 1 << 100|index out of bounds"
+ _ = t[1<<100 : 1<<110] // ERROR "overflows int|integer constant overflow" "invalid slice index 1 << 100|index out of bounds"
}
func main() {
av := T{}
pav := &av
- (**T).foo(&pav) // ERROR "no method foo|requires named type or pointer to named"
+ (**T).foo(&pav) // ERROR "no method .*foo|requires named type or pointer to named"
}
go f.bar() // ERROR "undefined"
defer f.bar() // ERROR "undefined"
- t := T{1} // ERROR "too many values"
+ t := T{1} // ERROR "too many"
go t.Bar()
}
func main() {
init() // ERROR "undefined.*init"
- runtime.init() // ERROR "undefined.*runtime\.init"
+ runtime.init() // ERROR "undefined.*runtime\.init|reference to undefined name"
var _ = init // ERROR "undefined.*init"
}
var a3 = T { S{}, 2, 3, 4, 5, 6 } // ERROR "convert|too many"
var a4 = [5]byte{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } // ERROR "index|too many"
var a5 = []byte { x: 2 } // ERROR "index"
-var a6 = []byte{1: 1, 2: 2, 1: 3} // ERROR "duplicate index"
+var a6 = []byte{1: 1, 2: 2, 1: 3} // ERROR "duplicate"
var ok1 = S { } // should be ok
var ok2 = T { S: ok1 } // should be ok
// cannot type-assert non-interfaces
f := 2.0
- _ = f.(int) // ERROR "non-interface type"
+ _ = f.(int) // ERROR "non-interface type|only valid for interface types"
}
goto L10
- goto go2 // ERROR "label go2 not defined"
+ goto go2 // ERROR "label go2 not defined|reference to undefined label .*go2"
}
func f1() {
switch x {
case 1:
- continue // ERROR "continue is not in a loop$"
+ continue // ERROR "continue is not in a loop$|continue statement not within for"
}
select {
default:
- continue // ERROR "continue is not in a loop$"
+ continue // ERROR "continue is not in a loop$|continue statement not within for"
}
}
}
}
- continue // ERROR "continue is not in a loop$"
+ continue // ERROR "continue is not in a loop$|continue statement not within for"
for {
- continue on // ERROR "continue label not defined: on"
+ continue on // ERROR "continue label not defined: on|invalid continue label .*on"
}
- break // ERROR "break is not in a loop, switch, or select"
+ break // ERROR "break is not in a loop, switch, or select|break statement not within for or switch or select"
for {
- break dance // ERROR "break label not defined: dance"
+ break dance // ERROR "break label not defined: dance|invalid break label .*dance"
}
for {
func main() {
m := make(map[int]int)
- delete() // ERROR "missing arguments"
- delete(m) // ERROR "missing second \(key\) argument"
+ delete() // ERROR "missing arguments|not enough arguments"
+ delete(m) // ERROR "missing second \(key\) argument|not enough arguments"
delete(m, 2, 3) // ERROR "too many arguments"
- delete(1, m) // ERROR "first argument to delete must be map"
-}
\ No newline at end of file
+ delete(1, m) // ERROR "first argument to delete must be map|argument 1 must be a map"
+}
var v Val
var pv = &v
-var _ = pv.val() // ERROR "pv.val undefined"
-var _ = pv.val // ERROR "pv.val undefined"
+var _ = pv.val() // ERROR "undefined"
+var _ = pv.val // ERROR "undefined"
func (t *T) g() int { return t.a }
-var _ = (T).g() // ERROR "needs pointer receiver|undefined"
+var _ = (T).g() // ERROR "needs pointer receiver|undefined|method requires pointer"
var v int
func main() {
- if c <- v { // ERROR "cannot use c <- v as value"
+ if c <- v { // ERROR "cannot use c <- v as value|send statement used as value"
}
}
-var _ = c <- v // ERROR "unexpected <-"
+var _ = c <- v // ERROR "unexpected <-|send statement used as value"