example$ head -99 $(find . -type f)
==> ./go.mod <==
module example.com
go 1.12
==> ./a/a.go <==
package a
type A int
func (A) F() {}
==> ./b/b.go <==
package b
import (
"example.com/a"
"example.com/c"
)
type B interface{ F() }
var _ B = a.A(0)
var _ B = c.C(0)
var _ = B.F
==> ./c/c.go <==
package c
type C int
func (C) F() {}
==> ./d/d.go <==
package d
import "example.com/b"
var _ interface{} = b.B.F
example$ ../xtools/gopls-v0.7.5 references ./a/a.go:#33
/Users/adonovan/w/example/b/b.go:13:11-12
/Users/adonovan/w/example/d/d.go:5:25-26
example$ ../xtools/gopls-v0.11.0 references ./a/a.go:#33
/Users/adonovan/w/example/b/b.go:13:11-12
/Users/adonovan/w/example/d/d.go:5:25-26
example$ ../xtools/gopls.head references ./a/a.go:#33
/Users/adonovan/w/example/d/d.go:5:25-26
This example applies the "implementations" query to method A.F. The correct answer includes both references to B.F, one in package b and one in package d. However, the new ("v2") implementation of "implementations" fails to report the reference from package b.
The reason is that v2 has completely different algorithms for the local and global cases (with disjoint results), and when it discovers that type A satisfies interface B and thus that it must include B.F among the global search targets, it forgets to search package b for local references to B.F.
The text was updated successfully, but these errors were encountered:
gopherbot
added
Tools
This label describes issues relating to any tools in the x/tools repository.
gopls
Issues related to the Go language server, gopls.
labels
Feb 13, 2023
This example applies the "implementations" query to method A.F. The correct answer includes both references to B.F, one in package b and one in package d. However, the new ("v2") implementation of "implementations" fails to report the reference from package b.
The reason is that v2 has completely different algorithms for the local and global cases (with disjoint results), and when it discovers that type A satisfies interface B and thus that it must include B.F among the global search targets, it forgets to search package b for local references to B.F.
The text was updated successfully, but these errors were encountered: