| 1 |
Regression test for 'references' bug golang/go#60369: a references |
| 2 |
query on the embedded type name T in struct{p.T} instead reports all |
| 3 |
references to the package name p. |
| 4 |
|
| 5 |
The bug was fixed in release go1.21 of go/types. |
| 6 |
|
| 7 |
-- go.mod -- |
| 8 |
module example.com |
| 9 |
go 1.12 |
| 10 |
|
| 11 |
-- a/a.go -- |
| 12 |
package a |
| 13 |
|
| 14 |
type A struct{} |
| 15 |
const C = 0 |
| 16 |
|
| 17 |
-- b/b.go -- |
| 18 |
package b |
| 19 |
|
| 20 |
import a "example.com/a" //@loc(adef, "a") |
| 21 |
type s struct { |
| 22 |
a.A //@loc(Aref1, "A"), loc(aref1, "a"), refs(Aref1, Aref1, Aref3), refs(aref1, adef, aref1, aref2, aref3) |
| 23 |
} |
| 24 |
var _ a.A //@loc(aref2, re" (a)"), loc(Aref2, "A") |
| 25 |
var _ = s{}.A //@loc(Aref3, "A") |
| 26 |
const _ = a.C //@loc(aref3, "a") |