Skip to content

Commit a4d9215

Browse files
committed
gopls/internal/test/marker: add a test for initialization cycle errors
CL 565838 changed the way initialization cycle errors were reporting, and would have broken gopls' parsing of continuation errors, yet no x/tools tests failed. Add a test for this behavior. Due to golang/go#65877, duplicate diagnostics had to be suppressed for this test. Updates golang/go#65877 Change-Id: I48244ac469ab78d2e40bf92ec061671cef72c6d9 Reviewed-on: https://go-review.googlesource.com/c/tools/+/566075 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
1 parent c111c4d commit a4d9215

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
This test verifies that gopls spreads initialization cycle errors across
2+
multiple declarations.
3+
4+
We set -ignore_extra_diags due to golang/go#65877: gopls produces redundant
5+
diagnostics for initialization cycles.
6+
7+
-- flags --
8+
-ignore_extra_diags
9+
10+
-- p.go --
11+
package p
12+
13+
var X = Y //@diag("X", re"initialization cycle")
14+
15+
var Y = Z //@diag("Y", re"initialization cycle")
16+
17+
var Z = X //@diag("Z", re"initialization cycle")

0 commit comments

Comments
 (0)