FIR2IR: read extension function type attribute properly
This commit is contained in:
committed by
teamcityserver
parent
b2d020606e
commit
d6bc6bec59
@@ -37,6 +37,13 @@ class Fir2IrBuiltIns(
|
||||
internal fun flexibleNullabilityAnnotationConstructorCall(): IrConstructorCall? =
|
||||
flexibleNullabilityAnnotationSymbol?.toConstructorCall()
|
||||
|
||||
private val extensionFunctionTypeAnnotationSymbol by lazy {
|
||||
annotationSymbolById(StandardClassIds.Annotations.ExtensionFunctionType)
|
||||
}
|
||||
|
||||
internal fun extensionFunctionTypeAnnotationConstructorCall(): IrConstructorCall? =
|
||||
extensionFunctionTypeAnnotationSymbol?.toConstructorCall()
|
||||
|
||||
private fun annotationSymbolById(id: ClassId): IrClassSymbol? =
|
||||
provider?.getClassSymbolById(id) ?: session.symbolProvider.getClassLikeSymbolByClassId(id)?.toSymbol(
|
||||
session, classifierStorage, ConversionTypeContext.DEFAULT
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.backend
|
||||
|
||||
import org.jetbrains.kotlin.fir.declarations.getAnnotationsByClassId
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
|
||||
import org.jetbrains.kotlin.fir.expressions.classId
|
||||
import org.jetbrains.kotlin.fir.languageVersionSettings
|
||||
@@ -121,6 +122,13 @@ class Fir2IrTypeConverter(
|
||||
typeAnnotations += it
|
||||
}
|
||||
}
|
||||
isExtensionFunctionType -> {
|
||||
if (annotations.getAnnotationsByClassId(StandardClassIds.Annotations.ExtensionFunctionType).isEmpty()) {
|
||||
builtIns.extensionFunctionTypeAnnotationConstructorCall()?.let {
|
||||
typeAnnotations += it
|
||||
}
|
||||
}
|
||||
}
|
||||
hasFlexibleNullability -> {
|
||||
builtIns.flexibleNullabilityAnnotationConstructorCall()?.let {
|
||||
typeAnnotations += it
|
||||
|
||||
Reference in New Issue
Block a user