1// build 2 3// Copyright 2022 The Go Authors. All rights reserved. 4// Use of this source code is governed by a BSD-style 5// license that can be found in the LICENSE file. 6 7package main 8 9type S[K, V any] struct { 10 E[V] 11} 12 13type E[K any] struct{} 14 15func (e E[K]) M() E[K] { 16 return e 17} 18 19func G[K, V any](V) { 20 _ = (*S[K, V]).M 21} 22 23func main() { 24 G[*int](new(int)) 25} 26