diff --git a/compiler/frontend/src/jet/Unit.jet b/compiler/frontend/src/jet/Unit.jet index 14795ac757a..b641390bed0 100644 --- a/compiler/frontend/src/jet/Unit.jet +++ b/compiler/frontend/src/jet/Unit.jet @@ -1,7 +1,7 @@ package jet -public class Tuple0 private () { +public class Unit private () { public class object { - public val VALUE: Tuple0 + public val VALUE: Unit } } \ No newline at end of file diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/ResolveSession.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/ResolveSession.java index bc5060da9b9..502f1ffa21e 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/ResolveSession.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/ResolveSession.java @@ -45,7 +45,7 @@ import java.util.List; import static org.jetbrains.jet.lang.resolve.lazy.ResolveSessionUtils.safeNameForLazyResolve; public class ResolveSession implements KotlinCodeAnalyzer { - private static final Function NO_ALIASES = new Function() { + public static final Function NO_ALIASES = new Function() { @Override public Name fun(FqName name) { 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 fdb4f688c5b..c5836f545d2 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 @@ -17,7 +17,6 @@ package org.jetbrains.jet.lang.types.lang; import com.google.common.base.Predicates; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -26,7 +25,6 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.PsiFileFactory; -import com.intellij.util.Function; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.DefaultModuleConfiguration; @@ -37,10 +35,10 @@ import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; import org.jetbrains.jet.lang.descriptors.impl.ValueParameterDescriptorImpl; import org.jetbrains.jet.lang.psi.JetFile; import org.jetbrains.jet.lang.resolve.*; -import org.jetbrains.jet.lang.resolve.lazy.declarations.FileBasedDeclarationProviderFactory; import org.jetbrains.jet.lang.resolve.lazy.KotlinCodeAnalyzer; -import org.jetbrains.jet.lang.resolve.lazy.storage.LockBasedStorageManager; import org.jetbrains.jet.lang.resolve.lazy.ResolveSession; +import org.jetbrains.jet.lang.resolve.lazy.declarations.FileBasedDeclarationProviderFactory; +import org.jetbrains.jet.lang.resolve.lazy.storage.LockBasedStorageManager; import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe; import org.jetbrains.jet.lang.resolve.name.Name; @@ -81,10 +79,6 @@ public class KotlinBuiltIns { BUILT_INS_DIR + "/Unit.jet" ); - private static final Map ALIASES = ImmutableMap.builder() - .put(new FqName("jet.Unit"), Name.identifier("Tuple0")) - .build(); - private static final int FUNCTION_TRAIT_COUNT = 23; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -202,7 +196,7 @@ public class KotlinBuiltIns { nullableAnyType = TypeUtils.makeNullable(anyType); nothingType = getBuiltInTypeByClassName("Nothing"); nullableNothingType = TypeUtils.makeNullable(nothingType); - unitType = getBuiltInTypeByClassName("Tuple0"); + unitType = getBuiltInTypeByClassName("Unit"); stringType = getBuiltInTypeByClassName("String"); annotationType = getBuiltInTypeByClassName("Annotation"); @@ -227,12 +221,7 @@ public class KotlinBuiltIns { builtInsModule, new SpecialModuleConfiguration(), new FileBasedDeclarationProviderFactory(storageManager, files), - new Function() { - @Override - public Name fun(FqName name) { - return ALIASES.get(name); - } - }, + ResolveSession.NO_ALIASES, Predicates.in(Sets.newHashSet(new FqNameUnsafe("jet.Any"), new FqNameUnsafe("jet.Nothing"))), new BindingTraceContext()); } @@ -428,7 +417,7 @@ public class KotlinBuiltIns { @NotNull public ClassDescriptor getUnit() { - return getBuiltInClassByName("Tuple0"); + return getBuiltInClassByName("Unit"); } @NotNull diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index aad775b153e..a91fdd5c6a7 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -1265,11 +1265,11 @@ public open class Throwable { public final fun printStackTrace() : Unit } -public final class Tuple0 { - private constructor Tuple0() +public final class Unit { + private constructor Unit() - public class object { - private constructor () + public class object { + private constructor () public final val VALUE : Unit } }