diff options
Diffstat (limited to 'gopls/internal/regtest/marker/testdata/rename/typeswitch.txt')
-rw-r--r-- | gopls/internal/regtest/marker/testdata/rename/typeswitch.txt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gopls/internal/regtest/marker/testdata/rename/typeswitch.txt b/gopls/internal/regtest/marker/testdata/rename/typeswitch.txt new file mode 100644 index 000000000..6743b99ef --- /dev/null +++ b/gopls/internal/regtest/marker/testdata/rename/typeswitch.txt @@ -0,0 +1,26 @@ +This test covers the special case of renaming a type switch var. + +-- p.go -- +package p + +func _(x interface{}) { + switch y := x.(type) { //@rename("y", z, yToZ) + case string: + print(y) //@rename("y", z, yToZ) + default: + print(y) //@rename("y", z, yToZ) + } +} + +-- @yToZ/p.go -- +package p + +func _(x interface{}) { + switch z := x.(type) { //@rename("y", z, yToZ) + case string: + print(z) //@rename("y", z, yToZ) + default: + print(z) //@rename("y", z, yToZ) + } +} + |