mirror of
https://github.com/golang/go.git
synced 2026-08-02 20:44:20 +08:00
go/types, types2: copy test from issue48703 into its own file
Monomorphization checks do not run in the presence of errors, which was suppressing the error from this test and making it appear to pass. This is a bit misleading. For #48703 For #80172 Change-Id: I87f672275df189366b88cf3ffac8b3d21b7a1a83 Reviewed-on: https://go-review.googlesource.com/c/go/+/798500 LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
0af88e584c
commit
999c71883b
@ -6,11 +6,6 @@ package p
|
||||
|
||||
import "unsafe"
|
||||
|
||||
// The actual example from the issue.
|
||||
type List[P any] struct{}
|
||||
|
||||
func (_ List[P]) m() (_ List[List[P]]) { return }
|
||||
|
||||
// Other types of recursion through methods.
|
||||
type R[P any] int
|
||||
|
||||
|
||||
9
src/internal/types/testdata/fixedbugs/issue80172.go
vendored
Normal file
9
src/internal/types/testdata/fixedbugs/issue80172.go
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// Copyright 2026 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.
|
||||
|
||||
package p
|
||||
|
||||
type List[P /* ERROR "instantiation cycle" */ any] struct{}
|
||||
|
||||
func (_ List[P]) m() (_ List[List[P]]) { return }
|
||||
Loading…
x
Reference in New Issue
Block a user