Skip to content
Browse files

Removed tuple-related methods from KotlinBuiltIns.

  • Loading branch information...
1 parent ca27637 commit fcc27f2ce63fa8160e0628c09ffe16e8bb55adea Evgeny Gerashchenko committed Mar 19, 2013
Showing with 0 additions and 63 deletions.
  1. +0 −63 compiler/frontend/src/org/jetbrains/jet/lang/types/lang/KotlinBuiltIns.java
View
63 compiler/frontend/src/org/jetbrains/jet/lang/types/lang/KotlinBuiltIns.java
@@ -144,9 +144,6 @@ public static KotlinBuiltIns getInstance() {
private final ImmutableSet<ClassDescriptor> extensionFunctionClassesSet;
- @Deprecated
- private final ImmutableSet<ClassDescriptor> tupleClassesSet;
-
private final EnumMap<PrimitiveType, ClassDescriptor> primitiveTypeToClass;
private final EnumMap<PrimitiveType, ClassDescriptor> primitiveTypeToArrayClass;
private final EnumMap<PrimitiveType, JetType> primitiveTypeToJetType;
@@ -176,7 +173,6 @@ private KotlinBuiltIns(@NotNull Project project) {
this.functionClassesSet = computeIndexedClasses("Function", getFunctionTraitCount());
this.extensionFunctionClassesSet = computeIndexedClasses("ExtensionFunction", getFunctionTraitCount());
- this.tupleClassesSet = computeIndexedClasses("Tuple", getFunctionTraitCount());
this.primitiveTypeToClass = new EnumMap<PrimitiveType, ClassDescriptor>(PrimitiveType.class);
this.primitiveTypeToJetType = new EnumMap<PrimitiveType, JetType>(PrimitiveType.class);
@@ -962,65 +958,6 @@ public JetType getDefaultBound() {
return getNullableAnyType();
}
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- // TUPLES
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
- @Deprecated
- @NotNull
- public List<JetType> getTupleElementTypes(@NotNull JetType type) {
- assert isTupleType(type);
- List<JetType> 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<JetType> arguments) {
- return getTupleType(Collections.<AnnotationDescriptor>emptyList(), arguments);
- }
-
- @NotNull
- @Deprecated
- public JetType getTupleType(@NotNull JetType... arguments) {
- return getTupleType(Collections.<AnnotationDescriptor>emptyList(), Arrays.asList(arguments));
- }
-
- @Deprecated
- private JetType getTupleType(List<AnnotationDescriptor> annotations, List<JetType> arguments) {
- if (annotations.isEmpty() && arguments.isEmpty()) {
- return getUnitType();
- }
- ClassDescriptor tuple = getTuple(arguments.size());
- List<TypeProjection> typeArguments = toProjections(arguments);
- return new JetTypeImpl(annotations, tuple.getTypeConstructor(), false, typeArguments, tuple.getMemberScope(typeArguments));
- }
-
- private static List<TypeProjection> toProjections(List<JetType> arguments) {
- List<TypeProjection> result = new ArrayList<TypeProjection>();
- for (JetType argument : arguments) {
- result.add(new TypeProjection(Variance.OUT_VARIANCE, argument));
- }
- return result;
- }
-
private static boolean setContainsClassOf(ImmutableSet<ClassDescriptor> set, JetType type) {
//noinspection SuspiciousMethodCalls
return set.contains(type.getConstructor().getDeclarationDescriptor());

0 comments on commit fcc27f2

Please sign in to comment.
Something went wrong with that request. Please try again.