| 1 | package test |
| 2 | |
| 3 | type embedded struct{} |
| 4 | |
| 5 | type S struct{ embedded } |
| 6 | |
| 7 | func (_ S) M() {} |
| 8 | |
| 9 | type C interface { |
| 10 | M() |
| 11 | S |
| 12 | } |
| 13 | |
| 14 | func G[T C]() { |
| 15 | t := T{embedded{}} |
| 16 | t.M() |
| 17 | } |
| 18 | |
| 19 | func F() { |
| 20 | G[S]() |
| 21 | } |
| 22 | |
| 23 | // WANT: |
| 24 | // F: G[testdata.S]() -> G[testdata.S] |
| 25 | // G[testdata.S]: (S).M(t2) -> S.M |
| 26 | // S.M: (testdata.S).M(t1) -> S.M |