Remove some usages of KotlinBuiltIns.getInstance()
Introduce DeclarationDescriptor.builtIns extension to get builtins where descriptors are available Introduce various utilities in KotlinBuiltIns to check for primitive types and get fq names of builtins
This commit is contained in:
+1
-1
@@ -194,7 +194,7 @@ public class InjectorForLazyResolveWithJava {
|
||||
this.argumentTypeResolver = new ArgumentTypeResolver();
|
||||
this.expressionTypingComponents = new ExpressionTypingComponents();
|
||||
this.expressionTypingServices = new ExpressionTypingServices(expressionTypingComponents);
|
||||
this.callExpressionResolver = new CallExpressionResolver(callResolver);
|
||||
this.callExpressionResolver = new CallExpressionResolver(callResolver, kotlinBuiltIns);
|
||||
this.controlStructureTypingUtils = new ControlStructureTypingUtils(callResolver);
|
||||
this.descriptorResolver = new DescriptorResolver();
|
||||
this.delegatedPropertyResolver = new DelegatedPropertyResolver();
|
||||
|
||||
@@ -221,7 +221,7 @@ public class InjectorForReplWithJava {
|
||||
this.argumentTypeResolver = new ArgumentTypeResolver();
|
||||
this.expressionTypingComponents = new ExpressionTypingComponents();
|
||||
this.expressionTypingServices = new ExpressionTypingServices(expressionTypingComponents);
|
||||
this.callExpressionResolver = new CallExpressionResolver(callResolver);
|
||||
this.callExpressionResolver = new CallExpressionResolver(callResolver, kotlinBuiltIns);
|
||||
this.controlStructureTypingUtils = new ControlStructureTypingUtils(callResolver);
|
||||
this.descriptorResolver = new DescriptorResolver();
|
||||
this.delegatedPropertyResolver = new DelegatedPropertyResolver();
|
||||
|
||||
+1
-1
@@ -219,7 +219,7 @@ public class InjectorForTopDownAnalyzerForJvm {
|
||||
this.argumentTypeResolver = new ArgumentTypeResolver();
|
||||
this.expressionTypingComponents = new ExpressionTypingComponents();
|
||||
this.expressionTypingServices = new ExpressionTypingServices(expressionTypingComponents);
|
||||
this.callExpressionResolver = new CallExpressionResolver(callResolver);
|
||||
this.callExpressionResolver = new CallExpressionResolver(callResolver, kotlinBuiltIns);
|
||||
this.controlStructureTypingUtils = new ControlStructureTypingUtils(callResolver);
|
||||
this.descriptorResolver = new DescriptorResolver();
|
||||
this.delegatedPropertyResolver = new DelegatedPropertyResolver();
|
||||
|
||||
+2
-2
@@ -35,6 +35,7 @@ import org.jetbrains.kotlin.types.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilPackage.getBuiltIns;
|
||||
import static org.jetbrains.kotlin.types.Variance.INVARIANT;
|
||||
|
||||
public class SingleAbstractMethodUtils {
|
||||
@@ -121,8 +122,7 @@ public class SingleAbstractMethodUtils {
|
||||
for (ValueParameterDescriptor parameter : valueParameters) {
|
||||
parameterTypes.add(parameter.getType());
|
||||
}
|
||||
return KotlinBuiltIns.getInstance().getFunctionType(
|
||||
Annotations.EMPTY, null, parameterTypes, returnType);
|
||||
return getBuiltIns(function).getFunctionType(Annotations.EMPTY, null, parameterTypes, returnType);
|
||||
}
|
||||
|
||||
private static boolean isSamInterface(@NotNull ClassDescriptor klass) {
|
||||
|
||||
+2
-1
@@ -50,6 +50,7 @@ import java.util.*;
|
||||
|
||||
import static org.jetbrains.kotlin.load.java.components.TypeUsage.*;
|
||||
import static org.jetbrains.kotlin.resolve.DescriptorUtils.getFqName;
|
||||
import static org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilPackage.getBuiltIns;
|
||||
import static org.jetbrains.kotlin.types.Variance.INVARIANT;
|
||||
|
||||
public class SignaturesPropagationData {
|
||||
@@ -263,7 +264,7 @@ public class SignaturesPropagationData {
|
||||
stableName != null ? stableName : originalParam.getName(),
|
||||
altType,
|
||||
originalParam.declaresDefaultValue(),
|
||||
varargCheckResult.isVararg ? KotlinBuiltIns.getInstance().getArrayElementType(altType) : null,
|
||||
varargCheckResult.isVararg ? getBuiltIns(originalParam).getArrayElementType(altType) : null,
|
||||
SourceElement.NO_SOURCE
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user