mirror of
https://github.com/golang/go
synced 2024-09-29 03:24:29 -06:00
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:
parent
cb357835d9
commit
042f051c03
@ -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 |
|
||||
|
12
src/go/types/testdata/fixedbugs/issue51658.go
vendored
12
src/go/types/testdata/fixedbugs/issue51658.go
vendored
@ -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 |
|
||||
|
Loading…
Reference in New Issue
Block a user