]> Cypherpunks repositories - gostls13.git/commitdiff
go/types, types2: consolidate a test file with different syntax errors
authorRobert Griesemer <gri@golang.org>
Tue, 30 Aug 2022 00:27:22 +0000 (17:27 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 2 Sep 2022 02:08:58 +0000 (02:08 +0000)
For #54511.

Change-Id: I317c5f9beed7f1de4979ec12c6ec8d5de71bac1c
Reviewed-on: https://go-review.googlesource.com/c/go/+/426554
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>

src/cmd/compile/internal/types2/testdata/fixedbugs/issue51658.go
src/go/types/testdata/fixedbugs/issue51658.go

index c437c92d291670d26e521dacfde2a5f008c7bb11..f32051caecb0e6adcb002844145d369c348b5e1b 100644 (file)
@@ -2,11 +2,15 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// This test checks syntax errors which differ between
+// go/parser and the syntax package.
+// TODO: consolidate eventually
+
 package p
 
-type F { // ERROR syntax error
+type F { // ERROR expected type|type declaration
        float64
-} // ERROR syntax error
+} // ERROR expected declaration|non-declaration statement
 
 func _[T F | int](x T) {
        _ = x == 0 // don't crash when recording type of 0
@@ -14,9 +18,9 @@ func _[T F | int](x T) {
 
 // test case from issue
 
-type FloatType { // ERROR syntax error
+type FloatType { // ERROR expected type|type declaration
        float32 | float64
-} // ERROR syntax error
+} // ERROR expected declaration|non-declaration statement
 
 type IntegerType interface {
        int8 | int16 | int32 | int64 | int |
index 04ce6a97600bcad802fa19678a8e97836154ab43..f32051caecb0e6adcb002844145d369c348b5e1b 100644 (file)
@@ -2,11 +2,15 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// This test checks syntax errors which differ between
+// go/parser and the syntax package.
+// TODO: consolidate eventually
+
 package p
 
-type F { // ERROR expected type
+type F { // ERROR expected type|type declaration
        float64
-} // ERROR expected declaration
+} // ERROR expected declaration|non-declaration statement
 
 func _[T F | int](x T) {
        _ = x == 0 // don't crash when recording type of 0
@@ -14,9 +18,9 @@ func _[T F | int](x T) {
 
 // test case from issue
 
-type FloatType { // ERROR expected type
+type FloatType { // ERROR expected type|type declaration
        float32 | float64
-} // ERROR expected declaration
+} // ERROR expected declaration|non-declaration statement
 
 type IntegerType interface {
        int8 | int16 | int32 | int64 | int |