| 1 |
This test verifies that the 'stub methods' quickfix is not offered in |
| 2 |
duplicate function declarations because type information for the |
| 3 |
duplicate declaration is missing from info.Defs. This scenario |
| 4 |
previously triggered bug.Reports before the cause was understood; see |
| 5 |
go.dev/issue/70666. |
| 6 |
|
| 7 |
-- go.mod -- |
| 8 |
module example.com |
| 9 |
|
| 10 |
go 1.22 |
| 11 |
|
| 12 |
-- a/a.go -- |
| 13 |
package a |
| 14 |
|
| 15 |
type I interface { |
| 16 |
M() |
| 17 |
} |
| 18 |
|
| 19 |
type T struct{} |
| 20 |
|
| 21 |
func foo() I { //@ diag(re"foo", re"redeclared") |
| 22 |
return T{} //@ diag(re"T{}", re"cannot use T|does not implement") |
| 23 |
} |
| 24 |
|
| 25 |
func foo() I { //@ diag(re"foo", re"redeclared") |
| 26 |
return T{} //@ codeaction(re"T{}", "quickfix", diag=re"cannot use T|does not implement", err=re"found 0 CodeActions") |
| 27 |
} |