]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] test: finish triaging all outstanding failing tests
authorRobert Griesemer <gri@golang.org>
Thu, 10 Dec 2020 04:14:07 +0000 (20:14 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 14 Dec 2020 21:28:48 +0000 (21:28 +0000)
Also: Adjusted error patterns for passing test that have different
error messages.

Change-Id: I216294b4c4855aa93da22cdc3c0b3303e54a8420
Reviewed-on: https://go-review.googlesource.com/c/go/+/277994
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

30 files changed:
test/convlit.go
test/fixedbugs/bug163.go
test/fixedbugs/bug192.go
test/fixedbugs/bug229.go
test/fixedbugs/bug325.go
test/fixedbugs/bug326.go
test/fixedbugs/bug340.go
test/fixedbugs/bug342.go
test/fixedbugs/bug350.go
test/fixedbugs/bug357.go
test/fixedbugs/bug362.go
test/fixedbugs/bug371.go
test/fixedbugs/bug379.go
test/fixedbugs/bug383.go
test/fixedbugs/bug386.go
test/fixedbugs/bug389.go
test/fixedbugs/bug390.go
test/fixedbugs/bug397.go
test/fixedbugs/bug416.go
test/fixedbugs/bug418.go
test/fixedbugs/bug462.go
test/fixedbugs/bug463.go
test/fixedbugs/bug487.go
test/makechan.go
test/makemap.go
test/run.go
test/slice3err.go
test/switch5.go
test/switch6.go
test/switch7.go

index 1c66c89e8800757618a80a0a120b9106584661a3..9d2eee79c5b63156547d17f0ca971714e8978838 100644 (file)
@@ -17,8 +17,8 @@ var x2 string = string(1)
 var x3 = int(1.5)     // ERROR "convert|truncate"
 var x4 int = int(1.5) // ERROR "convert|truncate"
 var x5 = "a" + string(1)
-var x6 = int(1e100)      // ERROR "overflow"
-var x7 = float32(1e1000) // ERROR "overflow"
+var x6 = int(1e100)      // ERROR "overflow|cannot convert"
+var x7 = float32(1e1000) // ERROR "overflow|cannot convert"
 
 // unsafe.Pointer can only convert to/from uintptr
 var _ = string(unsafe.Pointer(uintptr(65)))  // ERROR "convert|conversion"
@@ -34,7 +34,7 @@ var bad4 = "a" + 1   // ERROR "literals|incompatible|convert|invalid"
 var bad5 = "a" + 'a' // ERROR "literals|incompatible|convert|invalid"
 
 var bad6 int = 1.5       // ERROR "convert|truncate"
-var bad7 int = 1e100     // ERROR "overflow"
+var bad7 int = 1e100     // ERROR "overflow|truncated to int"
 var bad8 float32 = 1e200 // ERROR "overflow"
 
 // but these implicit conversions are okay
@@ -48,8 +48,8 @@ var _ = []rune("abc")
 var _ = []byte("abc")
 
 // implicit is not
-var _ []int = "abc"  // ERROR "cannot use|incompatible|invalid"
-var _ []byte = "abc" // ERROR "cannot use|incompatible|invalid"
+var _ []int = "abc"  // ERROR "cannot use|incompatible|invalid|cannot convert"
+var _ []byte = "abc" // ERROR "cannot use|incompatible|invalid|cannot convert"
 
 // named string is okay
 type Tstring string
@@ -70,5 +70,5 @@ var _ = Trune("abc") // ok
 var _ = Tbyte("abc") // ok
 
 // implicit is still not
-var _ Trune = "abc" // ERROR "cannot use|incompatible|invalid"
-var _ Tbyte = "abc" // ERROR "cannot use|incompatible|invalid"
+var _ Trune = "abc" // ERROR "cannot use|incompatible|invalid|cannot convert"
+var _ Tbyte = "abc" // ERROR "cannot use|incompatible|invalid|cannot convert"
index d69f6bef03a70d77327eec3692731fd49727f165..f3e0543cd744b461db12bad77b177eed30075884 100644 (file)
@@ -6,6 +6,4 @@
 
 package main
 
-func main() {
-       x⊛y := 1;     // ERROR "identifier"
-}
+var x⊛y int  // ERROR "invalid character .* in identifier"
index 679aaed1f2d05eb75c5240744276c6dd1b125899..a22e6a24824e66c0b2061f3bbdb6ec0d94b0b3b0 100644 (file)
@@ -8,4 +8,6 @@ package main
 
 import "fmt"   // GCCGO_ERROR "previous"
 
-var fmt int    // ERROR "redecl|redefinition"
+var _ = fmt.Println // avoid imported and not used error
+
+var fmt int    // ERROR "redecl|redefinition|fmt already declared"
index a30202fa2c75cd81542d67756981c8416087e80d..3cf1142a24ac49586e6f660615dfb2c13c2b8888 100644 (file)
@@ -14,7 +14,7 @@ func main() {
        // make sure error mentions that
        // name is unexported, not just "name not found".
 
-       t.common.name = nil // ERROR "unexported"
+       t.common.name = nil // ERROR "unexported|undefined"
 
-       println(testing.anyLowercaseName("asdf")) // ERROR "unexported"
+       println(testing.anyLowercaseName("asdf")) // ERROR "unexported|undefined"
 }
index e6528ae46a21b29d4d922da3d060e7d7b3e63a43..74d7bbb92383b6b602ca7fb3988239a6b902f1f1 100644 (file)
@@ -10,6 +10,6 @@ import "unsafe"
 
 func main() {
        var x unsafe.Pointer
-       println(*x) // ERROR "invalid indirect.*unsafe.Pointer"
+       println(*x) // ERROR "invalid indirect.*unsafe.Pointer|cannot indirect"
        var _ = (unsafe.Pointer)(nil).foo  // ERROR "foo"
 }
index 75d620cde533e266848dceea1ab007061f63a9cb..dfd8be80050edae795a665adb4d3ea9e0d9c902b 100644 (file)
@@ -19,7 +19,7 @@ func h() (_ int, _ error) {
 }
 
 func i() (int, error) {
-       return // ERROR "not enough arguments to return"
+       return // ERROR "not enough arguments to return|wrong number of return values"
 }
 
 func f1() (_ int, err error) {
index 542a6eab03d2d5f3e418866938dbe7df5acd48a8..117b28647a81c2f9fce8d68cb4a80adb32d1f472 100644 (file)
@@ -13,6 +13,6 @@ func main() {
        switch t := x.(type) {
        case 0:         // ERROR "type"
                t.x = 1
-               x.x = 1 // ERROR "type interface \{\}|reference to undefined field or method|interface with no methods"
+               x.x = 1 // ERROR "type interface \{\}|reference to undefined field or method|interface with no methods|undefined"
        }
 }
index f90f6f32cc71cd88ceba9e2e30401dff04fc23bc..ccf93a6d956c7216be9179b9760c3aacf184a9fc 100644 (file)
@@ -9,7 +9,7 @@
 package p
 
 type a interface {
-       foo(x int) (x int) // ERROR "duplicate argument|redefinition"
+       foo(x int) (x int) // ERROR "duplicate argument|redefinition|redeclared"
 }
 
 /*
index cdce1cfbe2c5753f06a29d0f6c82f63827747e77..39f91d43a93e7e764b29a6fa15f581e93ebbd53d 100644 (file)
@@ -12,4 +12,4 @@ func (T) m() {} // GCCGO_ERROR "previous"
 func (T) m() {} // ERROR "T[.]m redeclared|redefinition"
 
 func (*T) p() {} // GCCGO_ERROR "previous"
-func (*T) p() {} // ERROR "[(][*]T[)][.]p redeclared|redefinition"
+func (*T) p() {} // ERROR "[(][*]T[)][.]p redeclared|redefinition|redeclared"
index e9db50e88e97c0dcc07ad32c4075900bcbc639d2..0a4cbedd95ec6efa9d6e10b1158acf54d753b659 100644 (file)
@@ -15,7 +15,7 @@ func bla1() bool {
 
 func bla5() bool {
        _ = 1
-       false  // ERROR "false evaluated but not used|value computed is not used"
+       false  // ERROR "false evaluated but not used|value computed is not used|is not used"
        _ = 2
        return false
 }
index 771d13d4353d60e2c5e427858507dbbf99b393fb..98d6b0c82289ada9d1f90ce40da9a21e6426f577 100644 (file)
@@ -10,7 +10,7 @@
 package main
 
 var (
-       a = iota  // ERROR "undefined: iota|iota is only defined in const"
-       b = iota  // ERROR "undefined: iota|iota is only defined in const"
-       c = iota  // ERROR "undefined: iota|iota is only defined in const"
+       a = iota  // ERROR "undefined: iota|iota is only defined in const|cannot use iota outside constant declaration"
+       b = iota  // ERROR "undefined: iota|iota is only defined in const|cannot use iota outside constant declaration"
+       c = iota  // ERROR "undefined: iota|iota is only defined in const|cannot use iota outside constant declaration"
 )
index 3a626e523ce58578bc1766dad99d3e8e13211dcc..eb51b9ee86ec6597df9e8af7e6a80952a452cbde 100644 (file)
@@ -19,6 +19,6 @@ func main() {
        p.m()
 
        q := &p
-       q.m()  // ERROR "requires explicit dereference"
-       q.pm() // ERROR "requires explicit dereference"
+       q.m()  // ERROR "requires explicit dereference|undefined"
+       q.pm() // ERROR "requires explicit dereference|undefined"
 }
index 5638123d5028f5c80cdb67eee8bb604a36f847d8..aa078b6ff45c30158817a9268f36ccc48ab97c60 100644 (file)
@@ -14,5 +14,5 @@
 package main
 
 func main() {
-       1 + 2 // ERROR "1 \+ 2 evaluated but not used|value computed is not used"
+       1 + 2 // ERROR "1 \+ 2 evaluated but not used|value computed is not used|is not used"
 }
index dc2ecd61fbd66f51d6705fdc90c4f4ba9472093d..543ee10ac6065710977688fee44e06d1304f005e 100644 (file)
@@ -8,6 +8,6 @@
 
 package main
 func main() {
-       if 2e9 { }      // ERROR "2e.09|expected bool"
-       if 3.14+1i { }  // ERROR "3.14 . 1i|expected bool"
+       if 2e9 { }      // ERROR "2e.09|expected bool|non-boolean condition in if statement"
+       if 3.14+1i { }  // ERROR "3.14 . 1i|expected bool|non-boolean condition in if statement"
 }
index 889c8b0c12598d4d302962f40879a3f55b495e64..0899d1fc216b87a60d2b323f22ce3f9f0eb6f56b 100644 (file)
@@ -7,6 +7,6 @@
 // Issue 2451, 2452 
 package foo
 
-func f() error { return 0 } // ERROR "cannot use 0 .type int.|has no methods"
+func f() error { return 0 } // ERROR "cannot use 0 (.type int.)?|has no methods"
 
-func g() error { return -1 }  // ERROR "cannot use -1 .type int.|has no methods"
+func g() error { return -1 }  // ERROR "cannot use -1 (.type int.)?|has no methods"
index 14804c8471540694032dd449f737fd2191db437b..167e64e72c731a8f5185724469e71d3c992ac0e5 100644 (file)
@@ -9,4 +9,4 @@ package foo
 
 func fn(a float32) {}
 
-var f func(arg int) = fn  // ERROR "cannot use fn .type func.float32.. as type func.int. in assignment|different parameter types"
+var f func(arg int) = fn  // ERROR "cannot use fn .type func.float32.. as type func.int. in assignment|different parameter types|incompatible type"
index 7ce9e137035a4a679728f710b98d3129e96c1e9a..4ab24fb521a3dbd6650474a6be99c21f3152937b 100644 (file)
@@ -12,5 +12,5 @@ import "unsafe"
 
 func main() {
        var x *int
-       _ = unsafe.Pointer(x) - unsafe.Pointer(x) // ERROR "operator - not defined on unsafe.Pointer|expected integer, floating, or complex type"
+       _ = unsafe.Pointer(x) - unsafe.Pointer(x) // ERROR "(operator|operation) - not defined on unsafe.Pointer|expected integer, floating, or complex type"
 }
index 6188e3ee0cc642365d4bad6f04d551326e54f544..db8d652814d1e1ebecce5c716f11d5af0d6b9eff 100644 (file)
@@ -9,5 +9,5 @@ package main
 // Issue 2623
 var m = map[string]int {
        "abc":1,
-       1:2, // ERROR "cannot use 1.*as type string in map key|incompatible type"
+       1:2, // ERROR "cannot use 1.*as type string in map key|incompatible type|cannot convert"
 }
index 9fc3532f1d671d15b6f1bd9683aff854760e70a6..74b55cce18ae02b8f5ae6e28fb1c24cf7b21a106 100644 (file)
@@ -10,4 +10,4 @@ type T struct {
        X int
 }
 
-func (t *T) X() {} // ERROR "type T has both field and method named X|redeclares struct field name"
+func (t *T) X() {} // ERROR "type T has both field and method named X|redeclares struct field name|field and method with the same name"
index 64d86b34006e6f79b571affd866f4ff344d1878b..4e63e867b852669720b40ac84c15c8692ed23437 100644 (file)
@@ -13,10 +13,10 @@ func Two() (a, b int)
 
 // F used to compile.
 func F() (x interface{}, y int) {
-       return Two(), 0 // ERROR "single-value context"
+       return Two(), 0 // ERROR "single-value context|2\-valued"
 }
 
 // Recursive used to trigger an internal compiler error.
 func Recursive() (x interface{}, y int) {
-       return Recursive(), 0 // ERROR "single-value context"
+       return Recursive(), 0 // ERROR "single-value context|2\-valued"
 }
index 3df63b091ddbbf0ceda202ca95e908345b1c0afa..d1577e2ed74081dd02a77b78ec254343f58a7a15 100644 (file)
@@ -8,12 +8,14 @@ package main
 
 import "os"
 
+var _ = os.Open // avoid imported and not used error
+
 type T struct {
        File int
 }
 
 func main() {
        _ = T {
-               os.File: 1, // ERROR "unknown T? ?field"
+               os.File: 1, // ERROR "unknown T? ?field|invalid field"
        }
 }
index c7f92379c84a16902018d79ff28d9673ce327630..ed546bf74163da11b865a9ba0e87af246c3a7e5f 100644 (file)
@@ -9,11 +9,11 @@
 
 package main
 
-const a = a // ERROR "refers to itself|definition loop"
+const a = a // ERROR "refers to itself|definition loop|initialization loop"
 
 const (
        X    = A
-       A    = B // ERROR "refers to itself|definition loop"
+       A    = B // ERROR "refers to itself|definition loop|initialization loop"
        B    = D
        C, D = 1, A
 )
index e60af6c8e23b2dd6b0a11f85981f2e8585e766df..150d660abc20e6e552f2f175146a12287b3f7b1b 100644 (file)
@@ -14,11 +14,11 @@ func G() (int, int, int) {
 }
 
 func F() {
-       a, b := G()     // ERROR "mismatch"
-       a, b = G()      // ERROR "mismatch"
+       a, b := G()     // ERROR "mismatch|cannot initialize"
+       a, b = G()      // ERROR "mismatch|cannot assign"
        _, _ = a, b
 }
 
 func H() (int, int) {
-       return G()      // ERROR "too many|mismatch"
+       return G()      // ERROR "too many|mismatch|wrong number"
 }
index 6608620db396681d6b5e5c351b0fc68caa36123b..30a57456b31764ceea3babe723ae57b0b816d305 100644 (file)
@@ -15,14 +15,14 @@ type T chan byte
 var sink T
 
 func main() {
-       sink = make(T, -1)            // ERROR "negative buffer argument in make.*"
-       sink = make(T, uint64(1<<63)) // ERROR "buffer argument too large in make.*"
+       sink = make(T, -1)            // ERROR "negative buffer argument in make.*|must not be negative"
+       sink = make(T, uint64(1<<63)) // ERROR "buffer argument too large in make.*|out of bounds"
 
-       sink = make(T, 0.5) // ERROR "constant 0.5 truncated to integer"
+       sink = make(T, 0.5) // ERROR "constant 0.5 truncated to integer|truncated to int"
        sink = make(T, 1.0)
-       sink = make(T, float32(1.0)) // ERROR "non-integer buffer argument in make.*"
-       sink = make(T, float64(1.0)) // ERROR "non-integer buffer argument in make.*"
+       sink = make(T, float32(1.0)) // ERROR "non-integer buffer argument in make.*|must be integer"
+       sink = make(T, float64(1.0)) // ERROR "non-integer buffer argument in make.*|must be integer"
        sink = make(T, 1+0i)
-       sink = make(T, complex64(1+0i))  // ERROR "non-integer buffer argument in make.*"
-       sink = make(T, complex128(1+0i)) // ERROR "non-integer buffer argument in make.*"
+       sink = make(T, complex64(1+0i))  // ERROR "non-integer buffer argument in make.*|must be integer"
+       sink = make(T, complex128(1+0i)) // ERROR "non-integer buffer argument in make.*|must be integer"
 }
index 63998d708c31228ce5adc2d028de23d0800025e6..a60f5b5ee50059397ad27fd9f2b08dd2a5875809 100644 (file)
@@ -15,20 +15,20 @@ type T map[int]int
 var sink T
 
 func main() {
-       sink = make(T, -1)            // ERROR "negative size argument in make.*"
-       sink = make(T, uint64(1<<63)) // ERROR "size argument too large in make.*"
+       sink = make(T, -1)            // ERROR "negative size argument in make.*|must not be negative"
+       sink = make(T, uint64(1<<63)) // ERROR "size argument too large in make.*|out of bounds"
 
        // Test that errors are emitted at call sites, not const declarations
        const x = -1
-       sink = make(T, x) // ERROR "negative size argument in make.*"
+       sink = make(T, x) // ERROR "negative size argument in make.*|must not be negative"
        const y = uint64(1 << 63)
-       sink = make(T, y) // ERROR "size argument too large in make.*"
+       sink = make(T, y) // ERROR "size argument too large in make.*|out of bounds"
 
-       sink = make(T, 0.5) // ERROR "constant 0.5 truncated to integer"
+       sink = make(T, 0.5) // ERROR "constant 0.5 truncated to integer|truncated to int"
        sink = make(T, 1.0)
-       sink = make(T, float32(1.0)) // ERROR "non-integer size argument in make.*"
-       sink = make(T, float64(1.0)) // ERROR "non-integer size argument in make.*"
+       sink = make(T, float32(1.0)) // ERROR "non-integer size argument in make.*|must be integer"
+       sink = make(T, float64(1.0)) // ERROR "non-integer size argument in make.*|must be integer"
        sink = make(T, 1+0i)
-       sink = make(T, complex64(1+0i))  // ERROR "non-integer size argument in make.*"
-       sink = make(T, complex128(1+0i)) // ERROR "non-integer size argument in make.*"
+       sink = make(T, complex64(1+0i))  // ERROR "non-integer size argument in make.*|must be integer"
+       sink = make(T, complex128(1+0i)) // ERROR "non-integer size argument in make.*|must be integer"
 }
index b6c9d6050cfb133b9e133452e5ccc4fc6e656679..9cfd13ae481d928c42424289f5741a94640f8e40 100644 (file)
@@ -1926,68 +1926,34 @@ func overlayDir(dstRoot, srcRoot string) error {
 // List of files that the compiler cannot errorcheck with the new typechecker (compiler -G option).
 // Temporary scaffolding until we pass all the tests at which point this map can be removed.
 var excluded = map[string]bool{
-       "complit1.go":     true,
-       "const2.go":       true,
-       "convlit.go":      true,
+       "complit1.go":     true, // types2 reports extra errors
+       "const2.go":       true, // types2 not run after syntax errors
        "ddd1.go":         true, // issue #42987
        "directive.go":    true, // misplaced compiler directive checks
-       "float_lit3.go":   true,
-       "import1.go":      true,
+       "float_lit3.go":   true, // types2 reports extra errors
+       "import1.go":      true, // types2 reports extra errors
        "import5.go":      true, // issue #42988
-       "import6.go":      true,
-       "initializerr.go": true,
-       "linkname2.go":    true,
-       "makechan.go":     true,
-       "makemap.go":      true,
+       "import6.go":      true, // issue #43109
+       "initializerr.go": true, // types2 reports extra errors
+       "linkname2.go":    true, // error reported by noder (not running for types2 errorcheck test)
        "shift1.go":       true, // issue #42989
-       "slice3err.go":    true,
-       "switch3.go":      true,
-       "switch4.go":      true,
-       "switch5.go":      true,
-       "switch6.go":      true,
-       "switch7.go":      true,
+       "switch3.go":      true, // issue #43110
+       "switch4.go":      true, // error reported by noder (not running for types2 errorcheck test)
        "typecheck.go":    true, // invalid function is not causing errors when called
 
-       "fixedbugs/bug163.go":    true,
-       "fixedbugs/bug176.go":    true,
-       "fixedbugs/bug192.go":    true,
-       "fixedbugs/bug193.go":    true,
-       "fixedbugs/bug195.go":    true,
-       "fixedbugs/bug213.go":    true,
-       "fixedbugs/bug228.go":    true,
-       "fixedbugs/bug229.go":    true,
-       "fixedbugs/bug231.go":    true,
-       "fixedbugs/bug251.go":    true,
-       "fixedbugs/bug255.go":    true,
-       "fixedbugs/bug256.go":    true,
-       "fixedbugs/bug325.go":    true,
-       "fixedbugs/bug326.go":    true,
-       "fixedbugs/bug340.go":    true,
-       "fixedbugs/bug342.go":    true,
-       "fixedbugs/bug350.go":    true,
-       "fixedbugs/bug351.go":    true,
-       "fixedbugs/bug353.go":    true,
-       "fixedbugs/bug357.go":    true,
-       "fixedbugs/bug362.go":    true,
-       "fixedbugs/bug371.go":    true,
-       "fixedbugs/bug374.go":    true,
-       "fixedbugs/bug379.go":    true,
-       "fixedbugs/bug383.go":    true,
+       "fixedbugs/bug176.go":    true, // types2 reports all errors (pref: types2)
+       "fixedbugs/bug193.go":    true, // types2 bug: shift error not reported (fixed in go/types)
+       "fixedbugs/bug195.go":    true, // types2 reports slightly different (but correct) bugs
+       "fixedbugs/bug213.go":    true, // error reported by noder (not running for types2 errorcheck test)
+       "fixedbugs/bug228.go":    true, // types2 not run after syntax errors
+       "fixedbugs/bug231.go":    true, // types2 bug? (same error reported twice)
+       "fixedbugs/bug255.go":    true, // types2 reports extra errors
+       "fixedbugs/bug351.go":    true, // types2 reports extra errors
+       "fixedbugs/bug374.go":    true, // types2 reports extra errors
        "fixedbugs/bug385_32.go": true, // types2 doesn't produce "stack frame too large" error (32-bit specific)
        "fixedbugs/bug385_64.go": true, // types2 doesn't produce "stack frame too large" error
-       "fixedbugs/bug386.go":    true,
-       "fixedbugs/bug388.go":    true,
-       "fixedbugs/bug389.go":    true,
-       "fixedbugs/bug390.go":    true,
-       "fixedbugs/bug397.go":    true,
-       "fixedbugs/bug412.go":    true,
-       "fixedbugs/bug413.go":    true,
-       "fixedbugs/bug416.go":    true,
-       "fixedbugs/bug418.go":    true,
-       "fixedbugs/bug459.go":    true,
-       "fixedbugs/bug462.go":    true,
-       "fixedbugs/bug463.go":    true,
-       "fixedbugs/bug487.go":    true,
+       "fixedbugs/bug388.go":    true, // types2 not run due to syntax errors
+       "fixedbugs/bug412.go":    true, // types2 produces a follow-on error
 
        "fixedbugs/issue11362.go":  true, // types2 import path handling
        "fixedbugs/issue11590.go":  true, // types2 doesn't report a follow-on error (pref: types2)
@@ -1995,7 +1961,7 @@ var excluded = map[string]bool{
        "fixedbugs/issue11614.go":  true, // types2 reports an extra error
        "fixedbugs/issue13415.go":  true, // declared but not used conflict
        "fixedbugs/issue14520.go":  true, // missing import path error by types2
-       "fixedbugs/issue14540.go":  true, // types2 is missing a fallthrough error
+       "fixedbugs/issue14540.go":  true, // error reported by noder (not running for types2 errorcheck test)
        "fixedbugs/issue16428.go":  true, // types2 reports two instead of one error
        "fixedbugs/issue17038.go":  true, // types2 doesn't report a follow-on error (pref: types2)
        "fixedbugs/issue17645.go":  true, // multiple errors on same line
index 1309fdd56bde2f0ce0b8ce7222051a87f5c65a09..120ecbeccebce986363a45a194591e7d06e2b650 100644 (file)
@@ -17,12 +17,12 @@ func f() {
        _ = array[i:]
        _ = array[:j]
        _ = array[i:j]
-       _ = array[::] // ERROR "middle index required in 3-index slice" "final index required in 3-index slice"
-       _ = array[i::] // ERROR "middle index required in 3-index slice" "final index required in 3-index slice"
-       _ = array[:j:] // ERROR "final index required in 3-index slice"
-       _ = array[i:j:] // ERROR "final index required in 3-index slice"
-       _ = array[::k] // ERROR "middle index required in 3-index slice"
-       _ = array[i::k] // ERROR "middle index required in 3-index slice"
+       _ = array[::] // ERROR "middle index required in 3-index slice|invalid slice indices" "final index required in 3-index slice"
+       _ = array[i::] // ERROR "middle index required in 3-index slice|invalid slice indices" "final index required in 3-index slice"
+       _ = array[:j:] // ERROR "final index required in 3-index slice|invalid slice indices"
+       _ = array[i:j:] // ERROR "final index required in 3-index slice|invalid slice indices"
+       _ = array[::k] // ERROR "middle index required in 3-index slice|invalid slice indices"
+       _ = array[i::k] // ERROR "middle index required in 3-index slice|invalid slice indices"
        _ = array[:j:k]
        _ = array[i:j:k]
        
@@ -30,12 +30,12 @@ func f() {
        _ = slice[i:]
        _ = slice[:j]
        _ = slice[i:j]
-       _ = slice[::] // ERROR "middle index required in 3-index slice" "final index required in 3-index slice"
-       _ = slice[i::] // ERROR "middle index required in 3-index slice" "final index required in 3-index slice"
-       _ = slice[:j:] // ERROR "final index required in 3-index slice"
-       _ = slice[i:j:] // ERROR "final index required in 3-index slice"
-       _ = slice[::k] // ERROR "middle index required in 3-index slice"
-       _ = slice[i::k] // ERROR "middle index required in 3-index slice"
+       _ = slice[::] // ERROR "middle index required in 3-index slice|invalid slice indices" "final index required in 3-index slice"
+       _ = slice[i::] // ERROR "middle index required in 3-index slice|invalid slice indices" "final index required in 3-index slice"
+       _ = slice[:j:] // ERROR "final index required in 3-index slice|invalid slice indices"
+       _ = slice[i:j:] // ERROR "final index required in 3-index slice|invalid slice indices"
+       _ = slice[::k] // ERROR "middle index required in 3-index slice|invalid slice indices"
+       _ = slice[i::k] // ERROR "middle index required in 3-index slice|invalid slice indices"
        _ = slice[:j:k]
        _ = slice[i:j:k]
        
@@ -54,43 +54,43 @@ func f() {
 
        // check invalid indices
        _ = array[1:2]
-       _ = array[2:1] // ERROR "invalid slice index|inverted slice"
+       _ = array[2:1] // ERROR "invalid slice index|invalid slice indices|inverted slice"
        _ = array[2:2]
        _ = array[i:1]
        _ = array[1:j]
        _ = array[1:2:3]
-       _ = array[1:3:2] // ERROR "invalid slice index|inverted slice"
-       _ = array[2:1:3] // ERROR "invalid slice index|inverted slice"
-       _ = array[2:3:1] // ERROR "invalid slice index|inverted slice"
-       _ = array[3:1:2] // ERROR "invalid slice index|inverted slice"
-       _ = array[3:2:1] // ERROR "invalid slice index|inverted slice"
+       _ = array[1:3:2] // ERROR "invalid slice index|invalid slice indices|inverted slice"
+       _ = array[2:1:3] // ERROR "invalid slice index|invalid slice indices|inverted slice"
+       _ = array[2:3:1] // ERROR "invalid slice index|invalid slice indices|inverted slice"
+       _ = array[3:1:2] // ERROR "invalid slice index|invalid slice indices|inverted slice"
+       _ = array[3:2:1] // ERROR "invalid slice index|invalid slice indices|inverted slice"
        _ = array[i:1:2]
-       _ = array[i:2:1] // ERROR "invalid slice index|inverted slice"
+       _ = array[i:2:1] // ERROR "invalid slice index|invalid slice indices|inverted slice"
        _ = array[1:j:2]
-       _ = array[2:j:1] // ERROR "invalid slice index"
+       _ = array[2:j:1] // ERROR "invalid slice index|invalid slice indices"
        _ = array[1:2:k]
-       _ = array[2:1:k] // ERROR "invalid slice index|inverted slice"
+       _ = array[2:1:k] // ERROR "invalid slice index|invalid slice indices|inverted slice"
        
        _ = slice[1:2]
-       _ = slice[2:1] // ERROR "invalid slice index|inverted slice"
+       _ = slice[2:1] // ERROR "invalid slice index|invalid slice indices|inverted slice"
        _ = slice[2:2]
        _ = slice[i:1]
        _ = slice[1:j]
        _ = slice[1:2:3]
-       _ = slice[1:3:2] // ERROR "invalid slice index|inverted slice"
-       _ = slice[2:1:3] // ERROR "invalid slice index|inverted slice"
-       _ = slice[2:3:1] // ERROR "invalid slice index|inverted slice"
-       _ = slice[3:1:2] // ERROR "invalid slice index|inverted slice"
-       _ = slice[3:2:1] // ERROR "invalid slice index|inverted slice"
+       _ = slice[1:3:2] // ERROR "invalid slice index|invalid slice indices|inverted slice"
+       _ = slice[2:1:3] // ERROR "invalid slice index|invalid slice indices|inverted slice"
+       _ = slice[2:3:1] // ERROR "invalid slice index|invalid slice indices|inverted slice"
+       _ = slice[3:1:2] // ERROR "invalid slice index|invalid slice indices|inverted slice"
+       _ = slice[3:2:1] // ERROR "invalid slice index|invalid slice indices|inverted slice"
        _ = slice[i:1:2]
-       _ = slice[i:2:1] // ERROR "invalid slice index|inverted slice"
+       _ = slice[i:2:1] // ERROR "invalid slice index|invalid slice indices|inverted slice"
        _ = slice[1:j:2]
-       _ = slice[2:j:1] // ERROR "invalid slice index"
+       _ = slice[2:j:1] // ERROR "invalid slice index|invalid slice indices"
        _ = slice[1:2:k]
-       _ = slice[2:1:k] // ERROR "invalid slice index|inverted slice"
+       _ = slice[2:1:k] // ERROR "invalid slice index|invalid slice indices|inverted slice"
        
        _ = str[1:2]
-       _ = str[2:1] // ERROR "invalid slice index|inverted slice"
+       _ = str[2:1] // ERROR "invalid slice index|invalid slice indices|inverted slice"
        _ = str[2:2]
        _ = str[i:1]
        _ = str[1:j]
@@ -115,7 +115,7 @@ func f() {
        _ = slice[1:11]
        _ = slice[1:11:12]
        _ = slice[1:2:11]
-       _ = slice[1:11:3] // ERROR "invalid slice index"
-       _ = slice[11:2:3] // ERROR "invalid slice index|inverted slice"
+       _ = slice[1:11:3] // ERROR "invalid slice index|invalid slice indices"
+       _ = slice[11:2:3] // ERROR "invalid slice index|invalid slice indices|inverted slice"
        _ = slice[11:12:13]
 }
index ce95bf8d7b1b4f8c7328900ec18e64b50d091e00..dcf7ba0cf45f6b41b4136666fa5cb22e6ca0b4b7 100644 (file)
@@ -12,41 +12,41 @@ package main
 func f0(x int) {
        switch x {
        case 0:
-       case 0: // ERROR "duplicate case 0 in switch"
+       case 0: // ERROR "duplicate case (0 in switch)?"
        }
 
        switch x {
        case 0:
-       case int(0): // ERROR "duplicate case int.0. .value 0. in switch"
+       case int(0): // ERROR "duplicate case (int.0. .value 0. in switch)?"
        }
 }
 
 func f1(x float32) {
        switch x {
        case 5:
-       case 5: // ERROR "duplicate case 5 in switch"
-       case 5.0: // ERROR "duplicate case 5 in switch"
+       case 5: // ERROR "duplicate case (5 in switch)?"
+       case 5.0: // ERROR "duplicate case (5 in switch)?"
        }
 }
 
 func f2(s string) {
        switch s {
        case "":
-       case "": // ERROR "duplicate case .. in switch"
+       case "": // ERROR "duplicate case (.. in switch)?"
        case "abc":
-       case "abc": // ERROR "duplicate case .abc. in switch"
+       case "abc": // ERROR "duplicate case (.abc. in switch)?"
        }
 }
 
 func f3(e interface{}) {
        switch e {
        case 0:
-       case 0: // ERROR "duplicate case 0 in switch"
+       case 0: // ERROR "duplicate case (0 in switch)?"
        case int64(0):
        case float32(10):
-       case float32(10): // ERROR "duplicate case float32\(10\) .value 10. in switch"
+       case float32(10): // ERROR "duplicate case (float32\(10\) .value 10. in switch)?"
        case float64(10):
-       case float64(10): // ERROR "duplicate case float64\(10\) .value 10. in switch"
+       case float64(10): // ERROR "duplicate case (float64\(10\) .value 10. in switch)?"
        }
 }
 
@@ -82,13 +82,13 @@ func f7(a int) {
 func f8(r rune) {
        const x = 10
        switch r {
-       case 33, 33: // ERROR "duplicate case 33 in switch"
+       case 33, 33: // ERROR "duplicate case (33 in switch)?"
        case 34, '"': // ERROR "duplicate case '"' .value 34. in switch"
-       case 35, rune('#'): // ERROR "duplicate case rune.'#'. .value 35. in switch"
-       case 36, rune(36): // ERROR "duplicate case rune.36. .value 36. in switch"
-       case 37, '$'+1: // ERROR "duplicate case '\$' \+ 1 .value 37. in switch"
+       case 35, rune('#'): // ERROR "duplicate case (rune.'#'. .value 35. in switch)?"
+       case 36, rune(36): // ERROR "duplicate case (rune.36. .value 36. in switch)?"
+       case 37, '$'+1: // ERROR "duplicate case ('\$' \+ 1 .value 37. in switch)?"
        case 'b':
-       case 'a', 'b', 'c', 'd': // ERROR "duplicate case 'b' .value 98."
-       case x, x: // ERROR "duplicate case x .value 10."
+       case 'a', 'b', 'c', 'd': // ERROR "duplicate case ('b' .value 98.)?"
+       case x, x: // ERROR "duplicate case (x .value 10.)?"
        }
 }
index 9d102fef515d1cbfbe60ff8308b219e3ef479677..4f95d02615dbdb5b94adaf6d04d3b6b1b372f3af 100644 (file)
@@ -15,7 +15,7 @@ package main
 // Verify that type switch statements with impossible cases are detected by the compiler.
 func f0(e error) {
        switch e.(type) {
-       case int: // ERROR "impossible type switch case: e \(type error\) cannot have dynamic type int \(missing Error method\)"
+       case int: // ERROR "impossible type switch case: e \(type error\) cannot have dynamic type int \(missing Error method\)|impossible type assertion"
        }
 }
 
@@ -23,11 +23,11 @@ func f0(e error) {
 func f1(e interface{}) {
        switch e {
        default:
-       default: // ERROR "multiple defaults in switch"
+       default: // ERROR "multiple defaults( in switch)?"
        }
        switch e.(type) {
        default:
-       default: // ERROR "multiple defaults in switch"
+       default: // ERROR "multiple defaults( in switch)?"
        }
 }
 
@@ -41,6 +41,6 @@ func (*X) Foo() {}
 func f2() {
        var i I
        switch i.(type) {
-       case X: // ERROR "impossible type switch case: i \(type I\) cannot have dynamic type X \(Foo method has pointer receiver\)"
+       case X: // ERROR "impossible type switch case: i \(type I\) cannot have dynamic type X \(Foo method has pointer receiver\)|impossible type assertion"
        }
 }
index 75060669b33b05c68899bcc87f5ca059022d9303..3fb0129b15e2d35c0d0ad766d792d5562cc612d2 100644 (file)
@@ -27,7 +27,7 @@ func f4(e interface{}) {
        case struct {
                i int "tag2"
        }:
-       case struct { // ERROR "duplicate case struct { i int .tag1. } in type switch"
+       case struct { // ERROR "duplicate case struct { i int .tag1. } in type switch|duplicate case"
                i int "tag1"
        }:
        }