Minor. Fixed references to KotlinBuiltIns.UNIT_ALIAS.
This commit is contained in:
@@ -336,7 +336,7 @@ public class JetPsiUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
return KotlinBuiltIns.getInstance().UNIT_ALIAS.getName().equals(typeReference.getText());
|
||||
return KotlinBuiltIns.UNIT_ALIAS.getName().equals(typeReference.getText());
|
||||
}
|
||||
|
||||
public static boolean isSafeCall(@NotNull Call call) {
|
||||
|
||||
+1
-1
@@ -847,7 +847,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
||||
JetType result;
|
||||
if (operationType == JetTokens.PLUSPLUS || operationType == JetTokens.MINUSMINUS) {
|
||||
if (JetTypeChecker.INSTANCE.isSubtypeOf(returnType, KotlinBuiltIns.getInstance().getUnitType())) {
|
||||
result = ErrorUtils.createErrorType(KotlinBuiltIns.getInstance().UNIT_ALIAS.getName());
|
||||
result = ErrorUtils.createErrorType(KotlinBuiltIns.UNIT_ALIAS.getName());
|
||||
context.trace.report(INC_DEC_SHOULD_NOT_RETURN_UNIT.on(operationSign));
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -114,7 +114,7 @@ public class DescriptorRenderer implements Renderer<DeclarationDescriptor> {
|
||||
return escape(type.toString());
|
||||
}
|
||||
else if (KotlinBuiltIns.getInstance().isUnit(type)) {
|
||||
return escape(KotlinBuiltIns.getInstance().UNIT_ALIAS + (type.isNullable() ? "?" : ""));
|
||||
return escape(KotlinBuiltIns.UNIT_ALIAS + (type.isNullable() ? "?" : ""));
|
||||
}
|
||||
else if (KotlinBuiltIns.getInstance().isTupleType(type)) {
|
||||
return escape(renderTupleType(type, shortNamesOnly));
|
||||
|
||||
@@ -105,7 +105,7 @@ public class StandardLibraryReferenceResolver extends AbstractProjectComponent {
|
||||
scope = new WritableScopeImpl(scope, jetNamespace, RedeclarationHandler.THROW_EXCEPTION,
|
||||
"Builtin classes scope: needed to analyze builtins which depend on Unit type alias");
|
||||
scope.changeLockLevel(WritableScope.LockLevel.BOTH);
|
||||
scope.addClassifierAlias(KotlinBuiltIns.getInstance().UNIT_ALIAS, tuple0);
|
||||
scope.addClassifierAlias(KotlinBuiltIns.UNIT_ALIAS, tuple0);
|
||||
jetNamespace.setMemberScope(scope);
|
||||
|
||||
TopDownAnalyzer.processStandardLibraryNamespace(myProject, context, scope, jetNamespace,
|
||||
@@ -164,7 +164,7 @@ public class StandardLibraryReferenceResolver extends AbstractProjectComponent {
|
||||
}
|
||||
for (DeclarationDescriptor member : descriptors) {
|
||||
if (renderedOriginal.equals(DescriptorRenderer.TEXT.render(member).replace(TUPLE0_FQ_NAME.getFqName(),
|
||||
KotlinBuiltIns.getInstance().UNIT_ALIAS.getName()))) {
|
||||
KotlinBuiltIns.UNIT_ALIAS.getName()))) {
|
||||
return member;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,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(KotlinBuiltIns.getInstance().UNIT_ALIAS.getName()));
|
||||
myResult = new PrimitiveType(new IdentifierImpl(KotlinBuiltIns.UNIT_ALIAS.getName()));
|
||||
}
|
||||
else if (Node.PRIMITIVE_TYPES.contains(name)) {
|
||||
myResult = new PrimitiveType(new IdentifierImpl(AstUtil.upperFirstCharacter(name)));
|
||||
|
||||
Reference in New Issue
Block a user