From: Cuong Manh Le Date: Fri, 30 Sep 2022 15:34:42 +0000 (+0700) Subject: test: enable issue47631.go for Unified IR X-Git-Tag: go1.20rc1~777 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=76c1a501a5bb1e511655d89195b3b94b7a621cf9;p=gostls13.git 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 Run-TryBot: Cuong Manh Le Reviewed-by: Matthew Dempsky Reviewed-by: Dmitri Shuralyov TryBot-Result: Gopher Robot --- diff --git a/src/go/internal/gcimporter/gcimporter_test.go b/src/go/internal/gcimporter/gcimporter_test.go index 8c86bac54c..275287d428 100644 --- a/src/go/internal/gcimporter/gcimporter_test.go +++ b/src/go/internal/gcimporter/gcimporter_test.go @@ -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", } } diff --git a/test/run.go b/test/run.go index 5bd174e967..34b9675d2e 100644 --- a/test/run.go +++ b/test/run.go @@ -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 { diff --git a/test/typeparam/issue47631.go b/test/typeparam/issue47631.go index c2ce951cac..32fd837ddd 100644 --- a/test/typeparam/issue47631.go +++ b/test/typeparam/issue47631.go @@ -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 }