File: issue65024.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 (78 lines) | stat: -rw-r--r-- 1,432 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Regression example.com for #65024, "incorrect package qualification when
stubbing method in v2 module".

The second test (a-a) ensures that we don't use path-based heuristics
to guess the PkgName of an import.

-- a/v2/go.mod --
module example.com/a/v2
go 1.18

-- a/v2/a.go --
package a

type I interface { F() T }

type T struct {}

-- a/v2/b/b.go --
package b

import "example.com/a/v2"

type B struct{}

var _ a.I = &B{} //@ suggestedfix("&B{}", re"does not implement", out)

// This line makes the diff tidier.

-- @out/a/v2/b/b.go --
@@ -7 +7,5 @@
+// F implements a.I.
+func (b *B) F() a.T {
+	panic("unimplemented")
+}
+
@@ -10 +15 @@
-
-- a-a/v2/go.mod --
// This module has a hyphenated name--how posh.
// It won't do to use it as an identifier.
// The correct name is the one in the package decl,
// which in this case is not what the path heuristic would guess.
module example.com/a-a/v2
go 1.18

-- a-a/v2/a.go --
package a
type I interface { F() T }
type T struct {}

-- a-a/v2/b/b.go --
package b

// Note: no existing import of a.

type B struct{}

var _ I = &B{} //@ suggestedfix("&B{}", re"does not implement", out2)

// This line makes the diff tidier.

-- a-a/v2/b/import-a-I.go --
package b
import "example.com/a-a/v2"
type I = a.I

-- @out2/a-a/v2/b/b.go --
@@ -3 +3,2 @@
+import a "example.com/a-a/v2"
+
@@ -7 +9,5 @@
+// F implements a.I.
+func (b *B) F() a.T {
+	panic("unimplemented")
+}
+
@@ -10 +17 @@
-