Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed usages of getTuple() and isTupleType()

  • Loading branch information...
commit ca27637ef2ba648b44ad679863afb28308860d3d 1 parent 6e623c5
Evgeny Gerashchenko geevee authored
4 compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods.java
View
@@ -147,9 +147,9 @@ public void init() {
declareIntrinsicProperty(Name.identifier("CharSequence"), Name.identifier("length"), new StringLength());
declareIntrinsicProperty(Name.identifier("String"), Name.identifier("length"), new StringLength());
- Name tuple0Name = KotlinBuiltIns.getInstance().getTuple(0).getName();
+ Name unitName = KotlinBuiltIns.getInstance().getUnit().getName();
intrinsicsMap.registerIntrinsic(
- getClassObjectFqName(tuple0Name),
+ getClassObjectFqName(unitName),
Name.identifier("VALUE"), -1, new UnitValue());
for (PrimitiveType type : PrimitiveType.NUMBER_TYPES) {
3  compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/kotlinSignature/TypeTransformingVisitor.java
View
@@ -95,8 +95,9 @@ public JetType visitUserType(JetUserType type, Void data) {
String shortName = type.getReferenceExpression().getReferencedName();
String longName = (qualifier == null ? "" : qualifier.getText() + ".") + shortName;
+ // TODO remove this code when Unit will be not a synonym for Tuple0
if (KotlinBuiltIns.UNIT_ALIAS.getName().equals(longName)) {
- return visitCommonType(KotlinBuiltIns.getInstance().getTuple(0), type);
+ return visitCommonType(KotlinBuiltIns.getInstance().getUnit(), type);
}
return visitCommonType(longName, type);
5 compiler/frontend/src/org/jetbrains/jet/lang/types/lang/KotlinBuiltIns.java
View
@@ -430,6 +430,11 @@ public ClassDescriptor getNumber() {
}
@NotNull
+ public ClassDescriptor getUnit() {
+ return getBuiltInClassByName("Tuple0");
+ }
+
+ @NotNull
public ClassDescriptor getFunction(int parameterCount) {
return getBuiltInClassByName("Function" + parameterCount);
}
2  idea/src/org/jetbrains/jet/plugin/JetPluginUtil.java
View
@@ -54,7 +54,7 @@
public static boolean checkTypeIsStandard(JetType type, Project project) {
if (KotlinBuiltIns.getInstance().isAny(type) || KotlinBuiltIns.getInstance().isNothingOrNullableNothing(type) || KotlinBuiltIns.getInstance().isUnit(type) ||
- KotlinBuiltIns.getInstance().isTupleType(type) || KotlinBuiltIns.getInstance().isFunctionOrExtensionFunctionType(type)) {
+ KotlinBuiltIns.getInstance().isFunctionOrExtensionFunctionType(type)) {
return true;
}
2  idea/src/org/jetbrains/jet/plugin/references/BuiltInsReferenceResolver.java
View
@@ -56,7 +56,7 @@
public class BuiltInsReferenceResolver extends AbstractProjectComponent {
private BindingContext bindingContext = null;
- private final FqName TUPLE0_FQ_NAME = DescriptorUtils.getFQName(KotlinBuiltIns.getInstance().getTuple(0)).toSafe();
+ private final FqName TUPLE0_FQ_NAME = DescriptorUtils.getFQName(KotlinBuiltIns.getInstance().getUnit()).toSafe();
public BuiltInsReferenceResolver(
Project project,
Please sign in to comment.
Something went wrong with that request. Please try again.