FIR2IR: do not convert @ExtensionFunctionType twice

This commit is contained in:
Jinseong Jeon
2020-12-16 14:22:02 -08:00
committed by TeamCityServer
parent 4608431682
commit fe0c25693d
29 changed files with 168 additions and 230 deletions
@@ -23,13 +23,6 @@ class Fir2IrBuiltIns(
provider?.initComponents(components)
}
private val extensionFunctionTypeAnnotationSymbol by lazy {
annotationSymbolById(CompilerConeAttributes.ExtensionFunctionType.ANNOTATION_CLASS_ID)
}
internal fun extensionFunctionTypeAnnotationConstructorCall(): IrConstructorCall =
extensionFunctionTypeAnnotationSymbol!!.toConstructorCall()
private val enhancedNullabilityAnnotationSymbol by lazy {
annotationSymbolById(CompilerConeAttributes.EnhancedNullability.ANNOTATION_CLASS_ID)
}
@@ -88,9 +88,7 @@ class Fir2IrTypeConverter(
val firSymbol = this.lookupTag.toSymbol(session) ?: return createErrorType()
firSymbol.toSymbol(session, classifierStorage, typeContext)
}
val typeAnnotations: MutableList<IrConstructorCall> =
if (!isExtensionFunctionType) mutableListOf()
else mutableListOf(builtIns.extensionFunctionTypeAnnotationConstructorCall())
val typeAnnotations: MutableList<IrConstructorCall> = mutableListOf()
typeAnnotations += with(annotationGenerator) { annotations.toIrAnnotations() }
if (hasEnhancedNullability) {
builtIns.enhancedNullabilityAnnotationConstructorCall()?.let {