bazel syntax: rename SkylarkList.Tuple to Tuple
Tuple is one of the core data types of Starlark.
SkylarkList, which should be named Sequence, is the interface common to all indexable sequences.
Also, remove is SkylarkList.isTuple method.
The only class that isTuple is Tuple.
By a minor miracle, there were no references to Tuple from within the
copybara code base, so this renaming is unusually straightforward.
PiperOrigin-RevId: 279730954
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 ec4a25e..672fee8 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
@@ -1682,10 +1682,7 @@
" t2 += (3, 4)",
" return t1, t2",
"tuples = func()")
- .testLookup("tuples", SkylarkList.Tuple.of(
- SkylarkList.Tuple.of(1, 2),
- SkylarkList.Tuple.of(1, 2, 3, 4)
- ));
+ .testLookup("tuples", Tuple.of(Tuple.of(1, 2), Tuple.of(1, 2, 3, 4)));
}
@Test
@@ -2024,11 +2021,11 @@
// tuple
x = eval("(1,2)");
assertThat((Iterable<Object>) x).containsExactly(1, 2).inOrder();
- assertThat(((SkylarkList) x).isTuple()).isTrue();
+ assertThat(x).isInstanceOf(Tuple.class);
x = eval("(1,2) + (3,4)");
assertThat((Iterable<Object>) x).containsExactly(1, 2, 3, 4).inOrder();
- assertThat(((SkylarkList) x).isTuple()).isTrue();
+ assertThat(x).isInstanceOf(Tuple.class);
}
@Override