JetStandardClasses -> KotlinBuiltIns
This commit is contained in:
+2
-2
@@ -26,7 +26,7 @@ import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardClasses;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardLibrary;
|
||||
import org.jetbrains.jet.lang.types.lang.PrimitiveType;
|
||||
|
||||
@@ -70,7 +70,7 @@ public class JavaToKotlinClassMap extends JavaToKotlinClassMapBuilder implements
|
||||
primitiveTypesMap.put(jvmPrimitiveType.getWrapper().getFqName().getFqName(), JetStandardLibrary.getInstance().getNullablePrimitiveJetType(
|
||||
primitiveType));
|
||||
}
|
||||
primitiveTypesMap.put("void", JetStandardClasses.getUnitType());
|
||||
primitiveTypesMap.put("void", KotlinBuiltIns.getInstance().getUnitType());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ package org.jetbrains.jet.lang.resolve.java;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardClasses;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardLibrary;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
@@ -32,7 +32,7 @@ public abstract class JavaToKotlinClassMapBuilder {
|
||||
/*package*/ void init() {
|
||||
JetStandardLibrary standardLibrary = JetStandardLibrary.getInstance();
|
||||
|
||||
register(Object.class, JetStandardClasses.getAny());
|
||||
register(Object.class, KotlinBuiltIns.getInstance().getAny());
|
||||
register(String.class, standardLibrary.getString());
|
||||
register(CharSequence.class, standardLibrary.getCharSequence());
|
||||
register(Throwable.class, standardLibrary.getThrowable());
|
||||
|
||||
+4
-4
@@ -23,7 +23,7 @@ import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.types.*;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardClasses;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardLibrary;
|
||||
import org.jetbrains.jet.rt.signature.JetSignatureExceptionsAdapter;
|
||||
import org.jetbrains.jet.rt.signature.JetSignatureVariance;
|
||||
@@ -61,7 +61,7 @@ public abstract class JetTypeJetSignatureReader extends JetSignatureExceptionsAd
|
||||
}
|
||||
}
|
||||
if (descriptor == 'V') {
|
||||
return JetStandardClasses.getUnitType();
|
||||
return KotlinBuiltIns.getInstance().getUnitType();
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -119,12 +119,12 @@ public abstract class JetTypeJetSignatureReader extends JetSignatureExceptionsAd
|
||||
// TODO: this is the worst code in Kotlin project
|
||||
Matcher functionMatcher = Pattern.compile("jet\\.Function(\\d+)").matcher(ourName.getFqName());
|
||||
if (functionMatcher.matches()) {
|
||||
return JetStandardClasses.getFunction(Integer.parseInt(functionMatcher.group(1)));
|
||||
return KotlinBuiltIns.getInstance().getFunction(Integer.parseInt(functionMatcher.group(1)));
|
||||
}
|
||||
|
||||
Matcher patternMatcher = Pattern.compile("jet\\.Tuple(\\d+)").matcher(ourName.getFqName());
|
||||
if (patternMatcher.matches()) {
|
||||
return JetStandardClasses.getTuple(Integer.parseInt(patternMatcher.group(1)));
|
||||
return KotlinBuiltIns.getInstance().getTuple(Integer.parseInt(patternMatcher.group(1)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ import org.jetbrains.jet.lang.psi.JetTypeElement;
|
||||
import org.jetbrains.jet.lang.psi.JetTypeReference;
|
||||
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardClasses;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.jet.resolve.DescriptorRenderer;
|
||||
|
||||
import java.util.List;
|
||||
@@ -89,7 +89,7 @@ public abstract class ElementAlternativeSignatureData {
|
||||
@Nullable JetTypeReference altReturnTypeReference,
|
||||
@NotNull Map<TypeParameterDescriptor, TypeParameterDescriptorImpl> originalToAltTypeParameters) {
|
||||
if (altReturnTypeReference == null) {
|
||||
if (JetStandardClasses.isUnit(originalType)) {
|
||||
if (KotlinBuiltIns.getInstance().isUnit(originalType)) {
|
||||
return originalType;
|
||||
}
|
||||
else {
|
||||
|
||||
+6
-6
@@ -30,7 +30,7 @@ import org.jetbrains.jet.lang.resolve.java.JvmClassName;
|
||||
import org.jetbrains.jet.lang.resolve.java.KotlinToJavaTypesMap;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.types.*;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardClasses;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.jet.resolve.DescriptorRenderer;
|
||||
|
||||
import java.util.*;
|
||||
@@ -70,13 +70,13 @@ class TypeTransformingVisitor extends JetVisitor<JetType, Void> {
|
||||
@Override
|
||||
public JetType visitFunctionType(JetFunctionType type, Void data) {
|
||||
return visitCommonType(type.getReceiverTypeRef() == null
|
||||
? JetStandardClasses.getFunction(type.getParameters().size())
|
||||
: JetStandardClasses.getReceiverFunction(type.getParameters().size()), type);
|
||||
? KotlinBuiltIns.getInstance().getFunction(type.getParameters().size())
|
||||
: KotlinBuiltIns.getInstance().getExtensionFunction(type.getParameters().size()), type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JetType visitTupleType(JetTupleType type, Void data) {
|
||||
return visitCommonType(JetStandardClasses.getTuple(type.getComponentTypeRefs().size()), type);
|
||||
return visitCommonType(KotlinBuiltIns.getInstance().getTuple(type.getComponentTypeRefs().size()), type);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,8 +87,8 @@ class TypeTransformingVisitor extends JetVisitor<JetType, Void> {
|
||||
String shortName = type.getReferenceExpression().getReferencedName();
|
||||
String longName = (qualifier == null ? "" : qualifier.getText() + ".") + shortName;
|
||||
|
||||
if (JetStandardClasses.UNIT_ALIAS.getName().equals(longName)) {
|
||||
return visitCommonType(JetStandardClasses.getTuple(0), type);
|
||||
if (KotlinBuiltIns.getInstance().UNIT_ALIAS.getName().equals(longName)) {
|
||||
return visitCommonType(KotlinBuiltIns.getInstance().getTuple(0), type);
|
||||
}
|
||||
|
||||
return visitCommonType(longName, type);
|
||||
|
||||
+3
-3
@@ -31,7 +31,7 @@ import org.jetbrains.jet.lang.resolve.java.wrapper.PsiMethodWrapper;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.Variance;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardClasses;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardLibrary;
|
||||
import org.jetbrains.jet.rt.signature.JetSignatureAdapter;
|
||||
import org.jetbrains.jet.rt.signature.JetSignatureExceptionsAdapter;
|
||||
@@ -278,7 +278,7 @@ public final class JavaSignatureResolver {
|
||||
final List<JetType> upperBoundsForKotlin = typeParameter.upperBoundsForKotlin;
|
||||
assert upperBoundsForKotlin != null;
|
||||
if (upperBoundsForKotlin.size() == 0){
|
||||
typeParameterDescriptor.addUpperBound(JetStandardClasses.getNullableAnyType());
|
||||
typeParameterDescriptor.addUpperBound(KotlinBuiltIns.getInstance().getNullableAnyType());
|
||||
}
|
||||
else {
|
||||
for (JetType upperBound : upperBoundsForKotlin) {
|
||||
@@ -291,7 +291,7 @@ public final class JavaSignatureResolver {
|
||||
else {
|
||||
PsiClassType[] referencedTypes = typeParameter.psiTypeParameter.getExtendsList().getReferencedTypes();
|
||||
if (referencedTypes.length == 0){
|
||||
typeParameterDescriptor.addUpperBound(JetStandardClasses.getNullableAnyType());
|
||||
typeParameterDescriptor.addUpperBound(KotlinBuiltIns.getInstance().getNullableAnyType());
|
||||
}
|
||||
else if (referencedTypes.length == 1) {
|
||||
typeParameterDescriptor.addUpperBound(semanticServices.getTypeTransformer().transformToType(referencedTypes[0], JavaTypeTransformer.TypeUsage.UPPER_BOUND, typeVariableByPsiResolver));
|
||||
|
||||
+4
-4
@@ -32,7 +32,7 @@ import org.jetbrains.jet.lang.resolve.java.wrapper.PsiClassWrapper;
|
||||
import org.jetbrains.jet.lang.types.ErrorUtils;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.TypeUtils;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardClasses;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardLibrary;
|
||||
import org.jetbrains.jet.rt.signature.JetSignatureAdapter;
|
||||
import org.jetbrains.jet.rt.signature.JetSignatureExceptionsAdapter;
|
||||
@@ -123,7 +123,7 @@ public final class JavaSupertypesResolver {
|
||||
typeVariableResolver) {
|
||||
@Override
|
||||
protected void done(@NotNull JetType jetType) {
|
||||
if (!jetType.equals(JetStandardClasses.getAnyType())) {
|
||||
if (!jetType.equals(KotlinBuiltIns.getInstance().getAnyType())) {
|
||||
result.add(jetType);
|
||||
}
|
||||
}
|
||||
@@ -147,7 +147,7 @@ public final class JavaSupertypesResolver {
|
||||
|| DescriptorResolverUtils.OBJECT_FQ_NAME.equalsTo(psiClass.getQualifiedName())
|
||||
// TODO: annotations
|
||||
|| classDescriptor.getKind() == ClassKind.ANNOTATION_CLASS) {
|
||||
result.add(JetStandardClasses.getAnyType());
|
||||
result.add(KotlinBuiltIns.getInstance().getAnyType());
|
||||
}
|
||||
else {
|
||||
ClassDescriptor object = resolveJavaLangObject();
|
||||
@@ -156,7 +156,7 @@ public final class JavaSupertypesResolver {
|
||||
}
|
||||
else {
|
||||
//TODO: hack here
|
||||
result.add(JetStandardClasses.getAnyType());
|
||||
result.add(KotlinBuiltIns.getInstance().getAnyType());
|
||||
// throw new IllegalStateException("Could not resolve java.lang.Object");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user