| 1 |
Test of special case of 'implementation' query: aliases of basic types |
| 2 |
(rune vs int32) in the "tricky" (=generic) algorithm for unifying |
| 3 |
method signatures. |
| 4 |
|
| 5 |
We test both the local (intra-package) and global (cross-package) |
| 6 |
algorithms. |
| 7 |
|
| 8 |
-- go.mod -- |
| 9 |
module example.com |
| 10 |
go 1.18 |
| 11 |
|
| 12 |
-- a/a.go -- |
| 13 |
package a |
| 14 |
|
| 15 |
type C[T any] struct{} |
| 16 |
func (C[T]) F(rune, T) {} //@ loc(aCF, "F"), implementation("F", aIF, bIF) |
| 17 |
|
| 18 |
type I[T any] interface{ F(int32, T) } //@ loc(aIF, "F"), implementation("F", aCF, bCF, bIF) |
| 19 |
|
| 20 |
-- b/b.go -- |
| 21 |
package b |
| 22 |
|
| 23 |
type C[T any] struct{} |
| 24 |
func (C[T]) F(rune, T) {} //@ loc(bCF, "F"), implementation("F", aIF, bIF) |
| 25 |
|
| 26 |
type I[T any] interface{ F(int32, T) } //@ loc(bIF, "F"), implementation("F", aCF, aIF, bCF) |