1
0
mirror of https://github.com/golang/go synced 2024-11-11 18:51:37 -07:00

test: enable issue47631.go for Unified IR

Updates #53058

Change-Id: Ieaa500bea11f26f9a039196592bea67405bdf0ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/437215
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Cuong Manh Le 2022-09-30 22:34:42 +07:00 committed by Gopher Robot
parent aeedb5ab13
commit 76c1a501a5
3 changed files with 9 additions and 12 deletions

View File

@ -179,6 +179,7 @@ func TestImportTypeparamTests(t *testing.T) {
skip = map[string]string{
"equal.go": "inconsistent embedded sorting", // TODO(rfindley): investigate this.
"nested.go": "fails to compile", // TODO(rfindley): investigate this.
"issue47631.go": "can not handle local type declarations",
"issue55101.go": "fails to compile",
}
}

View File

@ -1984,6 +1984,7 @@ var types2Failures32Bit = setOf(
var go118Failures = setOf(
"fixedbugs/issue54343.go", // 1.18 compiler assigns receiver parameter to global variable
"typeparam/nested.go", // 1.18 compiler doesn't support function-local types with generics
"typeparam/issue47631.go", // 1.18 can not handle local type declarations
"typeparam/issue51521.go", // 1.18 compiler produces bad panic message and link error
"typeparam/issue54456.go", // 1.18 compiler fails to distinguish local generic types
"typeparam/issue54497.go", // 1.18 compiler is more conservative about inlining due to repeated issues
@ -2021,8 +2022,6 @@ var _ = setOf(
var unifiedFailures = setOf(
"closure3.go", // unified IR numbers closures differently than -d=inlfuncswithclosures
"escape4.go", // unified IR can inline f5 and f6; test doesn't expect this
"typeparam/issue47631.go", // unified IR can handle local type declarations
)
func setOf(keys ...string) map[string]bool {

View File

@ -1,34 +1,31 @@
// errorcheck
// compile
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// TODO: one day we will support internal type declarations, at which time this test will be removed.
package p
func g[T any]() {
type U []T // ERROR "type declarations inside generic functions are not currently supported"
type V []int // ERROR "type declarations inside generic functions are not currently supported"
type U []T
type V []int
}
type S[T any] struct {
}
func (s S[T]) m() {
type U []T // ERROR "type declarations inside generic functions are not currently supported"
type V []int // ERROR "type declarations inside generic functions are not currently supported"
type U []T
type V []int
}
func f() {
type U []int // ok
type U []int
}
type X struct {
}
func (x X) m() {
type U []int // ok
type U []int
}