3 // Copyright 2021 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.
7 // derived & expanded from cmd/compile/internal/types2/testdata/fixedbugs/issue44688.go2
11 type A1[T any] struct {
15 func (p *A1[T]) m1(val T) {
19 type A2[T any] interface {
23 type B1[T any] struct {
29 type B2[T any] interface {
33 type ImpA2[T any] struct {
37 func (a2 *ImpA2[T]) m2(s T) {
41 type C[T any] struct {
47 type D[T any] struct {
54 func test1[T any](arg T) {
55 // calling embedded methods
73 d.C.B1.A2 = &ImpA2[T]{}
77 // calling method expressions
80 // TODO(khr): reenable these.
84 // calling method values
94 // calling embedded methods
97 b1.A2 = &ImpA2[string]{}
106 b2 = &ImpA2[string]{}
111 d.C.B1.A1 = &A1[string]{}
112 d.C.B1.A2 = &ImpA2[string]{}
116 // calling method expressions
122 // calling method values
131 // actual test case from issue
133 type A[T any] struct{}
137 type B[T any] struct{ A[T] }