diff options
Diffstat (limited to 'gopls/internal/lsp/testdata/rename/generics/generics.go')
-rw-r--r-- | gopls/internal/lsp/testdata/rename/generics/generics.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gopls/internal/lsp/testdata/rename/generics/generics.go b/gopls/internal/lsp/testdata/rename/generics/generics.go new file mode 100644 index 000000000..977589c0c --- /dev/null +++ b/gopls/internal/lsp/testdata/rename/generics/generics.go @@ -0,0 +1,25 @@ +//go:build go1.18 +// +build go1.18 + +package generics + +type G[P any] struct { + F int +} + +func (G[_]) M() {} + +func F[P any](P) { + var p P //@rename("P", "Q") + _ = p +} + +func _() { + var x G[int] //@rename("G", "H") + _ = x.F //@rename("F", "K") + x.M() //@rename("M", "N") + + var y G[string] + _ = y.F + y.M() +} |