From fcc27f2ce63fa8160e0628c09ffe16e8bb55adea Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Tue, 19 Mar 2013 16:14:41 +0400 Subject: [PATCH] Removed tuple-related methods from KotlinBuiltIns. --- .../jet/lang/types/lang/KotlinBuiltIns.java | 63 ------------------- 1 file changed, 63 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/types/lang/KotlinBuiltIns.java b/compiler/frontend/src/org/jetbrains/jet/lang/types/lang/KotlinBuiltIns.java index fb1f206ea8f..d87b856b7c9 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/types/lang/KotlinBuiltIns.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/types/lang/KotlinBuiltIns.java @@ -144,9 +144,6 @@ public class KotlinBuiltIns { private final ImmutableSet extensionFunctionClassesSet; - @Deprecated - private final ImmutableSet tupleClassesSet; - private final EnumMap primitiveTypeToClass; private final EnumMap primitiveTypeToArrayClass; private final EnumMap primitiveTypeToJetType; @@ -176,7 +173,6 @@ public class KotlinBuiltIns { this.functionClassesSet = computeIndexedClasses("Function", getFunctionTraitCount()); this.extensionFunctionClassesSet = computeIndexedClasses("ExtensionFunction", getFunctionTraitCount()); - this.tupleClassesSet = computeIndexedClasses("Tuple", getFunctionTraitCount()); this.primitiveTypeToClass = new EnumMap(PrimitiveType.class); this.primitiveTypeToJetType = new EnumMap(PrimitiveType.class); @@ -962,65 +958,6 @@ public class KotlinBuiltIns { return getNullableAnyType(); } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - // TUPLES - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - @Deprecated - @NotNull - public List getTupleElementTypes(@NotNull JetType type) { - assert isTupleType(type); - List result = Lists.newArrayList(); - for (TypeProjection typeProjection : type.getArguments()) { - result.add(typeProjection.getType()); - } - return result; - } - - @NotNull - @Deprecated - public ClassDescriptor getTuple(int size) { - return getBuiltInClassByName("Tuple" + size); - } - - @Deprecated - public boolean isTupleType(@NotNull JetType type) { - return setContainsClassOf(tupleClassesSet, type); - } - - @NotNull - @Deprecated - public JetType getTupleType(@NotNull List arguments) { - return getTupleType(Collections.emptyList(), arguments); - } - - @NotNull - @Deprecated - public JetType getTupleType(@NotNull JetType... arguments) { - return getTupleType(Collections.emptyList(), Arrays.asList(arguments)); - } - - @Deprecated - private JetType getTupleType(List annotations, List arguments) { - if (annotations.isEmpty() && arguments.isEmpty()) { - return getUnitType(); - } - ClassDescriptor tuple = getTuple(arguments.size()); - List typeArguments = toProjections(arguments); - return new JetTypeImpl(annotations, tuple.getTypeConstructor(), false, typeArguments, tuple.getMemberScope(typeArguments)); - } - - private static List toProjections(List arguments) { - List result = new ArrayList(); - for (JetType argument : arguments) { - result.add(new TypeProjection(Variance.OUT_VARIANCE, argument)); - } - return result; - } - private static boolean setContainsClassOf(ImmutableSet set, JetType type) { //noinspection SuspiciousMethodCalls return set.contains(type.getConstructor().getDeclarationDescriptor());