File: issue57479.txt

package info (click to toggle)
golang-golang-x-tools 1%3A0.25.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,724 kB
  • sloc: javascript: 2,027; asm: 1,645; sh: 166; yacc: 155; makefile: 49; ansic: 8
file content (37 lines) | stat: -rw-r--r-- 939 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Test renaming a parameter to the name of an imported package
referenced by one of the function parameters.

See golang/go#57479

-- flags --
-min_go=go1.22

-- go.mod --
module golang.org/lsptests/rename

go 1.18
-- a/a.go --
package a

import (
    "fmt"
    "math"
)

func _(x fmt.Stringer) {} //@rename("x", "fmt", xToFmt)

func _(x int, y fmt.Stringer) {} //@rename("x", "fmt", xyToFmt)

func _(x [math.MaxInt]bool) {} //@rename("x", "math", xToMath)
-- @xToFmt/a/a.go --
@@ -8 +8 @@
-func _(x fmt.Stringer) {} //@rename("x", "fmt", xToFmt)
+func _(fmt fmt.Stringer) {} //@rename("x", "fmt", xToFmt)
-- @xToMath/a/a.go --
@@ -12 +12 @@
-func _(x [math.MaxInt]bool) {} //@rename("x", "math", xToMath)
+func _(math [math.MaxInt]bool) {} //@rename("x", "math", xToMath)
-- @xyToFmt/a/a.go --
@@ -10 +10 @@
-func _(x int, y fmt.Stringer) {} //@rename("x", "fmt", xyToFmt)
+func _(fmt int, y fmt.Stringer) {} //@rename("x", "fmt", xyToFmt)