blob: 897e9b149529dd95b0c36e1b8c63119c5a9a08d9 [file] [log] [blame]
Tests of suggested fixes for "undeclared name" diagnostics,
which are of ("compiler", "error") type.
-- go.mod --
module example.com
go 1.12
-- a.go --
package p
func a() {
z, _ := 1+y, 11 //@suggestedfix("y", re"(undeclared name|undefined): y", a)
_ = z
}
-- @a/a.go --
@@ -4 +4 @@
+ y :=
-- b.go --
package p
func b() {
if 100 < 90 {
} else if 100 > n+2 { //@suggestedfix("n", re"(undeclared name|undefined): n", b)
}
}
-- @b/b.go --
@@ -4 +4 @@
+ n :=
-- c.go --
package p
func c() {
for i < 200 { //@suggestedfix("i", re"(undeclared name|undefined): i", c)
}
r() //@diag("r", re"(undeclared name|undefined): r")
}
-- @c/c.go --
@@ -4 +4 @@
+ i :=