From 158bd1f681aa61153a9154f6ac65914dc89815e0 Mon Sep 17 00:00:00 2001 From: Laurent Le Brun Date: Mon, 18 May 2015 20:41:21 +0000 Subject: Remove dead code -- MOS_MIGRATED_REVID=93920816 --- .../devtools/build/lib/syntax/SkylarkType.java | 38 ---------------------- 1 file changed, 38 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/syntax') diff --git a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkType.java b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkType.java index cdbfebdd4b..23275eff39 100644 --- a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkType.java +++ b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkType.java @@ -33,7 +33,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Set; import javax.annotation.Nullable; @@ -529,10 +528,6 @@ public abstract class SkylarkType { return value instanceof BaseFunction; } - public static SkylarkFunctionType of(String name) { - return SkylarkFunctionType.of(name, TOP); - } - public static SkylarkFunctionType of(String name, SkylarkType returnType) { return new SkylarkFunctionType(name, returnType); } @@ -545,17 +540,6 @@ public abstract class SkylarkType { // Utility functions regarding types - /** - * For the purpose of type inference during validation, - * we upgrade the type for None as being Top, the type of everything, - * so None is compatible with anything as far as the validate method is concern. - * - * @param type a SkylarkType suitable for runtime type checking. - * @return the corresponding SkylarkType suitable for a type validation. - */ - public static SkylarkType typeForInference(SkylarkType type) { - return type == NONE ? TOP : type; - } public static SkylarkType typeOf(Object value) { if (value == null) { @@ -579,28 +563,6 @@ public abstract class SkylarkType { } } - boolean isStruct() { - return ClassObject.class.isAssignableFrom(getType()); - } - - boolean isList() { - return SkylarkList.class.isAssignableFrom(getType()); - } - - boolean isDict() { - return Map.class.isAssignableFrom(getType()); - } - - boolean isSet() { - return Set.class.isAssignableFrom(getType()); - } - - boolean isNset() { - // TODO(bazel-team): NestedSets are going to be a bit strange with 2 type info (validation - // and execution time). That can be cleaned up once we have complete type inference. - return SkylarkNestedSet.class.isAssignableFrom(getType()); - } - private static boolean isTypeAllowedInSkylark(Object object) { if (object instanceof NestedSet) { return false; -- cgit v1.2.3