Debian Codegraph @

gopls/internal/test/marker/testdata/quickfix/stubmethods/localiface.txt

raw
1 Test stubbing a method of a local interface.
2 It works so long as the methods have no free type parameters.
3
4 -- go.mod --
5 module example.com
6
7 go 1.18
8
9 -- a/a.go --
10 package a
11
12 func f[T any]() {
13 // nope: method C.f(T) would have a free type param, T.
14 type I interface{ f(T) }
15 var _ I = C(0) //@quickfixerr(re"C", re"missing method", re"found 0 CodeActions")
16
17 // ok: method C.f(int) is fine.
18 type J interface{ f(int) }
19 var _ J = C(0) //@quickfix(re"C", re"missing method", out)
20 }
21
22 type C int
23
24 -- @out/a/a.go --
25 @@ -15 +15,4 @@
26 +// f implements [J].
27 +func (c C) f(int) {
28 + panic("unimplemented")
29 +}
30