bazel syntax: define Starlark.call and use it everywhere
All calls of Starlark callable values go through this function,
whether from the interpreter or Java code. A follow-up change
will make it responsible for doing the push/pop of the call stack.
Also, rename StarlarkCallable.call to callImpl, since no-one should use
it directly. (And reorder its parameters.)
Also, remove sole external call to BaseFunction.callWithArgArray,
and inline it into sole remaining internal caller.
MethodDescriptor.callField now handles the two places that call
a @SkylarkCallable(structField)-annotated Java method.
Previously they were inconsistent in which "extra parameters" they
permitted. Now they allow Location and StarlarkSemantics,
but not StarlarkThread or FuncallExpression.
The annotation processor rejects useStarlarkThreadfor a structField.
(One instance was downgraded to useStarlarkSemantics.)
This is a breaking API change for copybara.
PiperOrigin-RevId: 285031076
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 9fb50eb..10b5472 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
@@ -2097,11 +2097,11 @@
}
@Override
- public Object call(
- List<Object> args,
- Map<String, Object> kwargs,
+ public Object callImpl(
+ StarlarkThread thread,
FuncallExpression call,
- StarlarkThread thread) {
+ List<Object> args,
+ Map<String, Object> kwargs) {
return "fromValues";
}
};