aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax/FuncallExpression.java
diff options
context:
space:
mode:
authorGravatar dslomov <dslomov@google.com>2017-09-22 12:44:18 +0200
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-09-22 13:40:28 +0200
commit5d41dbea25c6c9e3776516c7aa3598b8c153a410 (patch)
tree4f8f05b25a4a1737463334bff14c7b16355acb71 /src/main/java/com/google/devtools/build/lib/syntax/FuncallExpression.java
parent7b091c1397a82258e26ab5336df6c8dae1d97384 (diff)
Automated rollback of commit 17214ac78ffaec369d5d5bafe62a39730473cfaa.
*** Reason for rollback *** Rolled back commit enforces stricter parameter checks. Will fix and roll forward This creates several failures on the nightly build of Bazel: ERROR: /home/ci/workspace/Global/rules_closure-node=linux-x86_64/closure/protobuf/test/BUILD:23:1: no such package '@com_google_protobuf_protoc//': Cannot convert parameter 'url' to type string or sequence of strings, in method download_and_extract(List, string, string, string, string) of 'repository_ctx' and referenced by '//closure/protobuf/test:example_proto_gen'. ERROR: Analysis of target '//closure/protobuf/test:example_lib' failed; build aborted: no such package '@com_google_protobuf_protoc//': Cannot convert parameter 'url' to type string or sequence of strings, in method download_and_extract(List, string, string, string, string) of 'repository_ctx'. *** Original change description *** Check parameter types for methods when multiple types are allowed. Fixes #3714 RELNOTES: None. PiperOrigin-RevId: 169669802
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/syntax/FuncallExpression.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/syntax/FuncallExpression.java23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/FuncallExpression.java b/src/main/java/com/google/devtools/build/lib/syntax/FuncallExpression.java
index fbb4ef11ce..f3019e471a 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/FuncallExpression.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/FuncallExpression.java
@@ -25,7 +25,6 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.skylarkinterface.Param;
-import com.google.devtools.build.lib.skylarkinterface.ParamType;
import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable;
import com.google.devtools.build.lib.skylarkinterface.SkylarkInterfaceUtils;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
@@ -389,23 +388,11 @@ public final class FuncallExpression extends Expression {
}
private static SkylarkType getType(Param param) {
- if (param.allowedTypes().length > 0) {
- Preconditions.checkState(Object.class.equals(param.type()));
- SkylarkType result = SkylarkType.BOTTOM;
- for (ParamType paramType : param.allowedTypes()) {
- SkylarkType t = paramType.generic1() != Object.class
- ? SkylarkType.of(paramType.type(), paramType.generic1())
- : SkylarkType.of(paramType.type());
- result = SkylarkType.Union.of(result, t);
- }
- return result;
- } else {
- SkylarkType type =
- param.generic1() != Object.class
- ? SkylarkType.of(param.type(), param.generic1())
- : SkylarkType.of(param.type());
- return type;
- }
+ SkylarkType type =
+ param.generic1() != Object.class
+ ? SkylarkType.of(param.type(), param.generic1())
+ : SkylarkType.of(param.type());
+ return type;
}
/**