go/types, types2: consolidate a test file with different syntax errors

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>
This commit is contained in:
Robert Griesemer 2022-08-29 17:27:22 -07:00 committed by Gopher Robot
parent cb357835d9
commit 042f051c03
2 changed files with 16 additions and 8 deletions

View 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 |

View 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 |