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:
@@ -156,7 +156,7 @@ public class InjectorForTopDownAnalyzerForJs {
|
||||
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();
|
||||
|
||||
@@ -25,12 +25,13 @@ import org.jetbrains.kotlin.types.JetType
|
||||
import org.jetbrains.kotlin.types.TypeProjection
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
||||
|
||||
public val JetType.nameIfStandardType: Name?
|
||||
get() {
|
||||
val descriptor = getConstructor().getDeclarationDescriptor()
|
||||
|
||||
if (descriptor?.getContainingDeclaration() == KotlinBuiltIns.getInstance().getBuiltInsPackageFragment()) {
|
||||
if (descriptor?.getContainingDeclaration() == descriptor?.builtIns?.getBuiltInsPackageFragment()) {
|
||||
return descriptor?.getName()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user