Introduced JetStandardClasses.UNIT_ALIAS constant, got rid of hard-coding it in all code except for tests.

This commit is contained in:
Evgeny Gerashchenko
2012-05-15 12:40:01 +04:00
parent 151b3be99e
commit e294a8821f
6 changed files with 12 additions and 7 deletions
@@ -23,6 +23,7 @@ import org.jetbrains.jet.j2k.Converter;
import org.jetbrains.jet.j2k.J2KConverterFlags;
import org.jetbrains.jet.j2k.ast.*;
import org.jetbrains.jet.j2k.util.AstUtil;
import org.jetbrains.jet.lang.types.lang.JetStandardClasses;
import java.util.LinkedList;
import java.util.List;
@@ -61,7 +62,7 @@ public class TypeVisitor extends PsiTypeVisitor<Type> implements J2KVisitor {
final IdentifierImpl identifier = new IdentifierImpl(name);
if (name.equals("void")) {
myResult = new PrimitiveType(new IdentifierImpl("Unit"));
myResult = new PrimitiveType(new IdentifierImpl(JetStandardClasses.UNIT_ALIAS));
}
else if (Node.PRIMITIVE_TYPES.contains(name)) {
myResult = new PrimitiveType(new IdentifierImpl(AstUtil.upperFirstCharacter(name)));