]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] test: update regress tests for types2
authorMatthew Dempsky <mdempsky@google.com>
Mon, 17 May 2021 18:41:20 +0000 (11:41 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 19 May 2021 06:26:35 +0000 (06:26 +0000)
Followup to previous commit that extended test/run.go to run more
tests with -G=3. This CL updates a handful of easy test cases for
types2 compatibility.

Change-Id: I58a6f9ce6f9172d61dc25411536ee489ccb03ae0
Reviewed-on: https://go-review.googlesource.com/c/go/+/320610
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Dan Scales <danscales@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
test/fixedbugs/bug248.dir/bug2.go
test/fixedbugs/bug345.dir/main.go
test/fixedbugs/bug460.dir/b.go
test/fixedbugs/issue44432.go
test/fixedbugs/issue4909b.go
test/run.go

index c0fdecfdb7b1e2a05abfccb67bea8e85ada95b2e..92a7974679eae10349fe8f4f7817cbf39fbf28dd 100644 (file)
@@ -50,8 +50,8 @@ var p0i2 p1.I = t0(0) // ERROR "does not implement|incompatible"
 func foobar() {
        // check that cannot assign one to the other,
        // but can convert.
-       v0 = v1 // ERROR "assign"
-       v1 = v0 // ERROR "assign"
+       v0 = v1 // ERROR "assign|cannot use"
+       v1 = v0 // ERROR "assign|cannot use"
 
        v0 = p0.T(v1)
        v1 = p1.T(v0)
index b77a2fad5fba076e5c0e7ad8f3d87fcaccc057f3..a53d3e8586ed553a73d847d6b8493a95bcb9a513 100644 (file)
@@ -23,7 +23,7 @@ func main() {
        // main.go:27: cannot use &x (type *"io".SectionReader) as type *"/Users/rsc/g/go/test/fixedbugs/bug345.dir/io".SectionReader in function argument
 
        var w io.Writer
-       bufio.NewWriter(w) // ERROR "[\w.]+[^.]/io|has incompatible type"
+       bufio.NewWriter(w) // ERROR "[\w.]+[^.]/io|has incompatible type|cannot use"
        var x goio.SectionReader
-       io.SR(&x) // ERROR "[\w.]+[^.]/io|has incompatible type"
+       io.SR(&x) // ERROR "[\w.]+[^.]/io|has incompatible type|cannot use"
 }
index ef646946cf187ab02ef5a993f93e4d8e268a8da5..5d388fc413f783de1aa93fe6c0aacab463b87e63 100644 (file)
@@ -9,9 +9,9 @@ import "./a"
 var x a.Foo
 
 func main() {
-       x.int = 20    // ERROR "unexported field"
-       x.int8 = 20   // ERROR "unexported field"
-       x.error = nil // ERROR "unexported field"
-       x.rune = 'a'  // ERROR "unexported field"
-       x.byte = 20   // ERROR "unexported field"
+       x.int = 20    // ERROR "unexported field|undefined"
+       x.int8 = 20   // ERROR "unexported field|undefined"
+       x.error = nil // ERROR "unexported field|undefined"
+       x.rune = 'a'  // ERROR "unexported field|undefined"
+       x.byte = 20   // ERROR "unexported field|undefined"
 }
index c5fb67e0d782b6a5acceca35291c8add42705ad5..eec53f30008e3d889aeac58fcd57730b7b1e30eb 100644 (file)
@@ -8,6 +8,6 @@ package p
 
 var m = map[string]int{
        "a": 1,
-       1:   1, // ERROR "cannot use 1.*as type string in map key"
-       2:   2, // ERROR "cannot use 2.*as type string in map key"
+       1:   1, // ERROR "cannot use 1.*as.*string.*in map"
+       2:   2, // ERROR "cannot use 2.*as.*string.*in map"
 }
index 0f594e3db67be58142ad8ca6a89ba04f972b3f09..7d7922701a20ce8a1c51dc0bf89023e9901770b4 100644 (file)
@@ -73,7 +73,7 @@ func writeDot(ns ...int) {
                }
                fmt.Print(")")
                if isIndirect {
-                       fmt.Print(` // ERROR "indirection"`)
+                       fmt.Print(` // ERROR "indirection|embedded via a pointer"`)
                }
                fmt.Print("\n")
        }
index fc4e89fc64c4fe413e55d93c85dac939c5eb41bc..d64affb772b4aee225ae691f79e4a699e17e2e86 100644 (file)
@@ -2051,16 +2051,13 @@ var excludedFiles = map[string]bool{
        "fixedbugs/bug195.go":    true, // types2 reports slightly different (but correct) bugs
        "fixedbugs/bug228.go":    true, // types2 doesn't run when there are syntax errors
        "fixedbugs/bug231.go":    true, // types2 bug? (same error reported twice)
-       "fixedbugs/bug248.go":    true, // types2 reports different (but ok) error message
        "fixedbugs/bug255.go":    true, // types2 reports extra errors
-       "fixedbugs/bug345.go":    true, // types2 reports different (but ok) error message
        "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 missing error "type .* too large" (32-bit specific)
        "fixedbugs/bug388.go":    true, // types2 not run due to syntax errors
        "fixedbugs/bug412.go":    true, // types2 produces a follow-on error
        "fixedbugs/bug420.go":    true, // ICE in irgen
-       "fixedbugs/bug460.go":    true, // types2 reports different (but probably ok) error message
 
        "fixedbugs/issue10700.go":  true, // types2 reports ok hint, but does not match regexp
        "fixedbugs/issue11590.go":  true, // types2 doesn't report a follow-on error (pref: types2)
@@ -2095,10 +2092,8 @@ var excludedFiles = map[string]bool{
        "fixedbugs/issue4232.go":   true, // types2 reports (correct) extra errors
        "fixedbugs/issue43479.go":  true, // ICE in iexport due to Syms from the wrong package
        "fixedbugs/issue43962.go":  true, // types2 panics when importing package named "init"
-       "fixedbugs/issue44432.go":  true, // types2 reports different (but ok) error message
        "fixedbugs/issue4452.go":   true, // types2 reports (correct) extra errors
        "fixedbugs/issue4510.go":   true, // types2 reports different (but ok) line numbers
-       "fixedbugs/issue4909b.go":  true, // types2 reports different (but ok) error message
        "fixedbugs/issue5609.go":   true, // types2 needs a better error message
        "fixedbugs/issue6889.go":   true, // types2 can handle this without constant overflow
        "fixedbugs/issue7525b.go":  true, // types2 reports init cycle error on different line - ok otherwise