aboutsummaryrefslogtreecommitdiff
path: root/test/convert2.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2020-11-30 21:38:49 -0800
committerRobert Griesemer <gri@golang.org>2020-12-01 21:49:31 +0000
commit72ad2f44eaf8bb71ea100fd4acf7dd04384c7175 (patch)
tree40bb3522f5dcd398280bea526b44921f7b9e572d /test/convert2.go
parent87bc85a846d5dc2d8fe7dbda900d6066ab98f1a5 (diff)
downloadgo-72ad2f44eaf8bb71ea100fd4acf7dd04384c7175.tar.gz
go-72ad2f44eaf8bb71ea100fd4acf7dd04384c7175.zip
[dev.typeparams] test: add scaffolding to run.go to check compiler with -G flag
Added a new flag -G to run. Setting -G (as in: go run run.go -G) will run tests marked with "errorcheck" (and no other flags) also with the compiler using the new typechecker. Many tests don't pass yet (due to discrepancies in error messages). The top-level tests in the test directory which don't pass yet have been explicitly excluded, permitting to see the current status. Future CLs will bring error messages in sync and eventually all tests should pass. Change-Id: I7caf5eff413e173f68d092af4bbe458434718d74 Reviewed-on: https://go-review.googlesource.com/c/go/+/274313 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'test/convert2.go')
-rw-r--r--test/convert2.go74
1 files changed, 37 insertions, 37 deletions
diff --git a/test/convert2.go b/test/convert2.go
index c500638929..e7044b2453 100644
--- a/test/convert2.go
+++ b/test/convert2.go
@@ -22,7 +22,7 @@ func _() {
var t T
var u struct{}
s = s
- s = t // ERROR "cannot use .* in assignment"
+ s = t // ERROR "cannot use .* in assignment|incompatible type"
s = u
s = S(s)
s = S(t)
@@ -42,12 +42,12 @@ func _() {
x int "bar"
}
s = s
- s = t // ERROR "cannot use .* in assignment"
- s = u // ERROR "cannot use .* in assignment"
+ s = t // ERROR "cannot use .* in assignment|incompatible type"
+ s = u // ERROR "cannot use .* in assignment|incompatible type"
s = S(s)
s = S(t)
s = S(u)
- t = u // ERROR "cannot use .* in assignment"
+ t = u // ERROR "cannot use .* in assignment|incompatible type"
t = T(u)
}
@@ -63,12 +63,12 @@ func _() {
x E "bar"
}
s = s
- s = t // ERROR "cannot use .* in assignment"
- s = u // ERROR "cannot use .* in assignment"
+ s = t // ERROR "cannot use .* in assignment|incompatible type"
+ s = u // ERROR "cannot use .* in assignment|incompatible type"
s = S(s)
s = S(t)
s = S(u)
- t = u // ERROR "cannot use .* in assignment"
+ t = u // ERROR "cannot use .* in assignment|incompatible type"
t = T(u)
}
@@ -91,12 +91,12 @@ func _() {
} "bar"
}
s = s
- s = t // ERROR "cannot use .* in assignment"
- s = u // ERROR "cannot use .* in assignment"
+ s = t // ERROR "cannot use .* in assignment|incompatible type"
+ s = u // ERROR "cannot use .* in assignment|incompatible type"
s = S(s)
s = S(t)
s = S(u)
- t = u // ERROR "cannot use .* in assignment"
+ t = u // ERROR "cannot use .* in assignment|incompatible type"
t = T(u)
}
@@ -117,12 +117,12 @@ func _() {
x E2 "bar"
}
s = s
- s = t // ERROR "cannot use .* in assignment"
- s = u // ERROR "cannot use .* in assignment"
+ s = t // ERROR "cannot use .* in assignment|incompatible type"
+ s = u // ERROR "cannot use .* in assignment|incompatible type"
s = S(s)
s = S(t) // ERROR "cannot convert"
s = S(u) // ERROR "cannot convert"
- t = u // ERROR "cannot use .* in assignment"
+ t = u // ERROR "cannot use .* in assignment|incompatible type"
t = T(u)
}
@@ -142,12 +142,12 @@ func _() {
var t T
var u struct{ f func(E) }
s = s
- s = t // ERROR "cannot use .* in assignment"
- s = u // ERROR "cannot use .* in assignment"
+ s = t // ERROR "cannot use .* in assignment|incompatible type"
+ s = u // ERROR "cannot use .* in assignment|incompatible type"
s = S(s)
s = S(t)
s = S(u) // ERROR "cannot convert"
- t = u // ERROR "cannot use .* in assignment"
+ t = u // ERROR "cannot use .* in assignment|incompatible type"
t = T(u) // ERROR "cannot convert"
}
@@ -160,12 +160,12 @@ func _() {
var t *T
var u *struct{}
s = s
- s = t // ERROR "cannot use .* in assignment"
- s = u // ERROR "cannot use .* in assignment"
+ s = t // ERROR "cannot use .* in assignment|incompatible type"
+ s = u // ERROR "cannot use .* in assignment|incompatible type"
s = (*S)(s)
s = (*S)(t)
s = (*S)(u)
- t = u // ERROR "cannot use .* in assignment"
+ t = u // ERROR "cannot use .* in assignment|incompatible type"
t = (*T)(u)
}
@@ -180,12 +180,12 @@ func _() {
x int "bar"
}
s = s
- s = t // ERROR "cannot use .* in assignment"
- s = u // ERROR "cannot use .* in assignment"
+ s = t // ERROR "cannot use .* in assignment|incompatible type"
+ s = u // ERROR "cannot use .* in assignment|incompatible type"
s = (*S)(s)
s = (*S)(t)
s = (*S)(u)
- t = u // ERROR "cannot use .* in assignment"
+ t = u // ERROR "cannot use .* in assignment|incompatible type"
t = (*T)(u)
}
@@ -201,12 +201,12 @@ func _() {
x E "bar"
}
s = s
- s = t // ERROR "cannot use .* in assignment"
- s = u // ERROR "cannot use .* in assignment"
+ s = t // ERROR "cannot use .* in assignment|incompatible type"
+ s = u // ERROR "cannot use .* in assignment|incompatible type"
s = (*S)(s)
s = (*S)(t)
s = (*S)(u)
- t = u // ERROR "cannot use .* in assignment"
+ t = u // ERROR "cannot use .* in assignment|incompatible type"
t = (*T)(u)
}
@@ -229,12 +229,12 @@ func _() {
} "bar"
}
s = s
- s = t // ERROR "cannot use .* in assignment"
- s = u // ERROR "cannot use .* in assignment"
+ s = t // ERROR "cannot use .* in assignment|incompatible type"
+ s = u // ERROR "cannot use .* in assignment|incompatible type"
s = (*S)(s)
s = (*S)(t)
s = (*S)(u)
- t = u // ERROR "cannot use .* in assignment"
+ t = u // ERROR "cannot use .* in assignment|incompatible type"
t = (*T)(u)
}
@@ -255,12 +255,12 @@ func _() {
x E2 "bar"
}
s = s
- s = t // ERROR "cannot use .* in assignment"
- s = u // ERROR "cannot use .* in assignment"
+ s = t // ERROR "cannot use .* in assignment|incompatible type"
+ s = u // ERROR "cannot use .* in assignment|incompatible type"
s = (*S)(s)
s = (*S)(t) // ERROR "cannot convert"
s = (*S)(u) // ERROR "cannot convert"
- t = u // ERROR "cannot use .* in assignment"
+ t = u // ERROR "cannot use .* in assignment|incompatible type"
t = (*T)(u)
}
@@ -280,12 +280,12 @@ func _() {
var t *T
var u *struct{ f func(E) }
s = s
- s = t // ERROR "cannot use .* in assignment"
- s = u // ERROR "cannot use .* in assignment"
+ s = t // ERROR "cannot use .* in assignment|incompatible type"
+ s = u // ERROR "cannot use .* in assignment|incompatible type"
s = (*S)(s)
s = (*S)(t)
s = (*S)(u) // ERROR "cannot convert"
- t = u // ERROR "cannot use .* in assignment"
+ t = u // ERROR "cannot use .* in assignment|incompatible type"
t = (*T)(u) // ERROR "cannot convert"
}
@@ -305,11 +305,11 @@ func _() {
var t *T
var u *struct{ f func(E) }
s = s
- s = t // ERROR "cannot use .* in assignment"
- s = u // ERROR "cannot use .* in assignment"
+ s = t // ERROR "cannot use .* in assignment|incompatible type"
+ s = u // ERROR "cannot use .* in assignment|incompatible type"
s = (*S)(s)
s = (*S)(t)
s = (*S)(u) // ERROR "cannot convert"
- t = u // ERROR "cannot use .* in assignment"
+ t = u // ERROR "cannot use .* in assignment|incompatible type"
t = (*T)(u) // ERROR "cannot convert"
}