diff options
author | Googler <noreply@google.com> | 2016-05-03 05:48:41 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-05-03 08:40:37 +0000 |
commit | 08bd44c23ef2b5c7cc93828509bd4c50309afdbc (patch) | |
tree | e7c0e027467e95fe36866141a74501a5d2610a6f /src/test/java/com/google/devtools | |
parent | a7fea8a1467a89adde75e67bc99bf0e040f71fe9 (diff) |
Prioritize kwarg presence error in invokeObjectMethod.
I believe the original intention of this error check was to always fail if kwargs were present (while Skylark doesn't support kwargs, at least). However, the current code will most likely fail at findJavaMethod because only the args (i.e. not the kwargs) are used to find a matching method.
This issue has already been encountered on the bazel-discuss group (g/bazel-discuss/hHyf2txlS70).
With the proposed modification, I believe any kwargs provided to Skylark methods will cause the kwarg-specific error.
--
MOS_MIGRATED_REVID=121345719
Diffstat (limited to 'src/test/java/com/google/devtools')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java | 4 |
1 files changed, 2 insertions, 2 deletions
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 7ee189cd9e..7679e39cd7 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 @@ -552,8 +552,8 @@ public class SkylarkEvaluationTest extends EvaluationTest { new SkylarkTest() .update("mock", new Mock()) .testIfExactError("Keyword arguments are not allowed when calling a java method" - + "\nwhile calling method 'string' for type Mock", - "mock.string(key=True)"); + + "\nwhile calling method 'isEmpty' for type Mock", + "mock.isEmpty(str='abc')"); } @Test |