Permalink
Browse files

Renamed Tuple0 to Unit, removed aliasing.

  • Loading branch information...
1 parent 20e5990 commit 8a021abaa5d58ef7b389bd1ffc3a5c3328550f7d Evgeny Gerashchenko committed Mar 19, 2013
@@ -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
}
}
@@ -45,7 +45,7 @@
import static org.jetbrains.jet.lang.resolve.lazy.ResolveSessionUtils.safeNameForLazyResolve;
public class ResolveSession implements KotlinCodeAnalyzer {
- private static final Function<FqName, Name> NO_ALIASES = new Function<FqName, Name>() {
+ public static final Function<FqName, Name> NO_ALIASES = new Function<FqName, Name>() {
@Override
public Name fun(FqName name) {
@@ -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.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.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 @@
BUILT_INS_DIR + "/Unit.jet"
);
- private static final Map<FqName, Name> ALIASES = ImmutableMap.<FqName, Name>builder()
- .put(new FqName("jet.Unit"), Name.identifier("Tuple0"))
- .build();
-
private static final int FUNCTION_TRAIT_COUNT = 23;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -202,7 +196,7 @@ private void initialize() {
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 @@ private KotlinCodeAnalyzer createLazyResolveSession(@NotNull Project project) th
builtInsModule,
new SpecialModuleConfiguration(),
new FileBasedDeclarationProviderFactory(storageManager, files),
- new Function<FqName, Name>() {
- @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 ClassDescriptor getNumber() {
@NotNull
public ClassDescriptor getUnit() {
- return getBuiltInClassByName("Tuple0");
+ return getBuiltInClassByName("Unit");
}
@NotNull
@@ -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 <class-object-for-Tuple0> {
- private constructor <class-object-for-Tuple0>()
+ public class object <class-object-for-Unit> {
+ private constructor <class-object-for-Unit>()
public final val VALUE : Unit
}
}

0 comments on commit 8a021ab

Please sign in to comment.