Require LValues to have at least one variable.
In other words, we now forbid these:
[] = []
() = ()
_, [] = f()
RELNOTES[INC]:
lvalues must have define at least one variable (i.e. we forbid `[] = f()`).
PiperOrigin-RevId: 160981283
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
index b5c6a70..24c16e5 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
@@ -1377,6 +1377,10 @@
new SkylarkTest()
.testIfErrorContains("type 'int' is not a collection", "[x2 + y2 for x2, y2 in (1, 2)]");
+
+ new SkylarkTest()
+ // returns [2] in Python, it's an error in Skylark
+ .testIfErrorContains("invalid lvalue", "[2 for [] in [()]]");
}
@Override