src/internal/types/testdata/fixedbugs/issue49579.go
raw| 1 | // Copyright 2021 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package p |
| 6 | |
| 7 | type I[F any] interface { |
| 8 | Q(*F) |
| 9 | } |
| 10 | |
| 11 | func G[F any]() I[any] { |
| 12 | return g /* ERRORx `cannot use g\[F\]{} .* as I\[any\] value in return statement: g\[F\] does not implement I\[any\] \(method Q has pointer receiver\)` */ [F]{} |
| 13 | } |
| 14 | |
| 15 | type g[F any] struct{} |
| 16 | |
| 17 | func (*g[F]) Q(*any) {} |