From: Robert Griesemer Date: Tue, 30 Aug 2022 00:27:22 +0000 (-0700) Subject: go/types, types2: consolidate a test file with different syntax errors X-Git-Tag: go1.20rc1~1280 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=042f051c03d35fb0adcb0b6a7e2d78a35342ae98;p=gostls13.git 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 Run-TryBot: Robert Griesemer TryBot-Result: Gopher Robot Reviewed-by: Robert Griesemer Auto-Submit: Robert Griesemer --- diff --git a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue51658.go b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue51658.go index c437c92d29..f32051caec 100644 --- a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue51658.go +++ b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue51658.go @@ -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 | diff --git a/src/go/types/testdata/fixedbugs/issue51658.go b/src/go/types/testdata/fixedbugs/issue51658.go index 04ce6a9760..f32051caec 100644 --- a/src/go/types/testdata/fixedbugs/issue51658.go +++ b/src/go/types/testdata/fixedbugs/issue51658.go @@ -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 |