diff --git a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt index 12a197aef4d..7789c637457 100644 --- a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt +++ b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt @@ -1405,7 +1405,7 @@ class DeclarationsConverter( if (type.asText.isEmpty()) { return buildErrorTypeRef { diagnostic = ConeSimpleDiagnostic("Unwrapped type is null", DiagnosticKind.Syntax) } } - var typeModifiers = TypeModifier() //TODO what with suspend? + var typeModifiers = TypeModifier() var firType: FirTypeRef = buildErrorTypeRef { diagnostic = ConeSimpleDiagnostic("Incomplete code", DiagnosticKind.Syntax) } var afterLPar = false type.forEachChildren { @@ -1415,7 +1415,7 @@ class DeclarationsConverter( MODIFIER_LIST -> if (!afterLPar || typeModifiers.hasNoAnnotations()) typeModifiers = convertTypeModifierList(it) USER_TYPE -> firType = convertUserType(it) NULLABLE_TYPE -> firType = convertNullableType(it) - FUNCTION_TYPE -> firType = convertFunctionType(it) + FUNCTION_TYPE -> firType = convertFunctionType(it, isSuspend = typeModifiers.hasSuspend) DYNAMIC_TYPE -> firType = buildDynamicTypeRef { source = type.toFirSourceElement() isMarkedNullable = false @@ -1529,7 +1529,7 @@ class DeclarationsConverter( /** * @see org.jetbrains.kotlin.parsing.KotlinParsing.parseFunctionType */ - private fun convertFunctionType(functionType: LighterASTNode, isNullable: Boolean = false): FirTypeRef { + private fun convertFunctionType(functionType: LighterASTNode, isNullable: Boolean = false, isSuspend: Boolean = false): FirTypeRef { var receiverTypeReference: FirTypeRef? = null lateinit var returnTypeReference: FirTypeRef val valueParametersList = mutableListOf() @@ -1550,6 +1550,7 @@ class DeclarationsConverter( if (receiverTypeReference != null) { annotations += extensionFunctionAnnotation } + this.isSuspend = isSuspend } } diff --git a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt index 28906d75d1b..ecfc5daf0ac 100644 --- a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt +++ b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt @@ -1138,6 +1138,7 @@ class RawFirBuilder( FirFunctionTypeRefBuilder().apply { this.source = source isMarkedNullable = isNullable + isSuspend = typeReference.hasModifier(SUSPEND_KEYWORD) receiverTypeRef = unwrappedElement.receiverTypeReference.convertSafe() // TODO: probably implicit type should not be here returnTypeRef = unwrappedElement.returnTypeReference.toFirOrErrorType() diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSpecificTypeResolverTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSpecificTypeResolverTransformer.kt index 1f6eca8878c..f574ee35e1f 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSpecificTypeResolverTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSpecificTypeResolverTransformer.kt @@ -32,6 +32,7 @@ class FirSpecificTypeResolverTransformer( source = functionTypeRef.source type = typeResolver.resolveType(functionTypeRef, towerScope) isMarkedNullable = functionTypeRef.isMarkedNullable + isSuspend = functionTypeRef.isSuspend receiverTypeRef = functionTypeRef.receiverTypeRef returnTypeRef = functionTypeRef.returnTypeRef annotations += functionTypeRef.annotations diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirIntegerLiteralTypeScope.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirIntegerLiteralTypeScope.kt index f34916723ad..82c331b6dc4 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirIntegerLiteralTypeScope.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirIntegerLiteralTypeScope.kt @@ -137,7 +137,10 @@ class FirIntegerOperator @FirImplementationDetail constructor( } } -class FirILTTypeRefPlaceHolder(isUnsigned: Boolean) : FirResolvedTypeRef() { +class FirILTTypeRefPlaceHolder( + isUnsigned: Boolean, + override val isSuspend: Boolean = false +) : FirResolvedTypeRef() { override val source: FirSourceElement? get() = null override val annotations: List get() = emptyList() override var type: ConeIntegerLiteralType = ConeIntegerLiteralTypeImpl(0, isUnsigned) diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirComposedSuperTypeRef.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirComposedSuperTypeRef.kt index 1ed11b2f99c..ec0b6f71074 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirComposedSuperTypeRef.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirComposedSuperTypeRef.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirComposedSuperTypeRef : FirPureAbstractElement(), FirTypeRef { abstract override val source: FirSourceElement? abstract override val annotations: List + abstract override val isSuspend: Boolean abstract val superTypeRefs: List override fun accept(visitor: FirVisitor, data: D): R = visitor.visitComposedSuperTypeRef(this, data) diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirDelegatedTypeRef.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirDelegatedTypeRef.kt index b227a998862..e5583399dd3 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirDelegatedTypeRef.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirDelegatedTypeRef.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirDelegatedTypeRef : FirPureAbstractElement(), FirTypeRef { abstract override val source: FirSourceElement? abstract override val annotations: List + abstract override val isSuspend: Boolean abstract val delegate: FirExpression? abstract val typeRef: FirTypeRef diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirDynamicTypeRef.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirDynamicTypeRef.kt index 450996ff36e..d9dbefe144b 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirDynamicTypeRef.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirDynamicTypeRef.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirDynamicTypeRef : FirPureAbstractElement(), FirTypeRefWithNullability { abstract override val source: FirSourceElement? abstract override val annotations: List + abstract override val isSuspend: Boolean abstract override val isMarkedNullable: Boolean override fun accept(visitor: FirVisitor, data: D): R = visitor.visitDynamicTypeRef(this, data) diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirErrorTypeRef.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirErrorTypeRef.kt index 526efeedbca..e1ca73ed746 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirErrorTypeRef.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirErrorTypeRef.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirErrorTypeRef : FirResolvedTypeRef(), FirDiagnosticHolder { abstract override val source: FirSourceElement? abstract override val annotations: List + abstract override val isSuspend: Boolean abstract override val type: ConeKotlinType abstract override val delegatedTypeRef: FirTypeRef? abstract override val diagnostic: ConeDiagnostic diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirFunctionTypeRef.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirFunctionTypeRef.kt index 31d7aacf740..0d2e253ed88 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirFunctionTypeRef.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirFunctionTypeRef.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.fir.visitors.* interface FirFunctionTypeRef : FirTypeRefWithNullability { override val source: FirSourceElement? override val annotations: List + override val isSuspend: Boolean override val isMarkedNullable: Boolean val receiverTypeRef: FirTypeRef? val valueParameters: List diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirImplicitTypeRef.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirImplicitTypeRef.kt index 6f9aa7f99a1..7c9eaab7e6c 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirImplicitTypeRef.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirImplicitTypeRef.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirImplicitTypeRef : FirPureAbstractElement(), FirTypeRef { abstract override val source: FirSourceElement? abstract override val annotations: List + abstract override val isSuspend: Boolean override fun accept(visitor: FirVisitor, data: D): R = visitor.visitImplicitTypeRef(this, data) diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirResolvedFunctionTypeRef.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirResolvedFunctionTypeRef.kt index 1aaed119e44..61655e8da02 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirResolvedFunctionTypeRef.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirResolvedFunctionTypeRef.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirResolvedFunctionTypeRef : FirResolvedTypeRef(), FirFunctionTypeRef { abstract override val source: FirSourceElement? abstract override val annotations: List + abstract override val isSuspend: Boolean abstract override val type: ConeKotlinType abstract override val delegatedTypeRef: FirTypeRef? abstract override val isMarkedNullable: Boolean diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirResolvedTypeRef.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirResolvedTypeRef.kt index b95d543881a..0f7511380dc 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirResolvedTypeRef.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirResolvedTypeRef.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirResolvedTypeRef : FirPureAbstractElement(), FirTypeRef { abstract override val source: FirSourceElement? abstract override val annotations: List + abstract override val isSuspend: Boolean abstract val type: ConeKotlinType abstract val delegatedTypeRef: FirTypeRef? diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirTypeRef.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirTypeRef.kt index 0e08b829c76..bee528d2c2d 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirTypeRef.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirTypeRef.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.fir.visitors.* interface FirTypeRef : FirAnnotationContainer { override val source: FirSourceElement? override val annotations: List + val isSuspend: Boolean override fun accept(visitor: FirVisitor, data: D): R = visitor.visitTypeRef(this, data) diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirTypeRefWithNullability.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirTypeRefWithNullability.kt index 77def82d872..d185ecf0fd4 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirTypeRefWithNullability.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirTypeRefWithNullability.kt @@ -17,6 +17,7 @@ import org.jetbrains.kotlin.fir.visitors.* interface FirTypeRefWithNullability : FirTypeRef { override val source: FirSourceElement? override val annotations: List + override val isSuspend: Boolean val isMarkedNullable: Boolean override fun accept(visitor: FirVisitor, data: D): R = visitor.visitTypeRefWithNullability(this, data) diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirUserTypeRef.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirUserTypeRef.kt index cba919c0143..6bef706be4b 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirUserTypeRef.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/FirUserTypeRef.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.fir.visitors.* abstract class FirUserTypeRef : FirPureAbstractElement(), FirTypeRefWithNullability { abstract override val source: FirSourceElement? abstract override val annotations: List + abstract override val isSuspend: Boolean abstract override val isMarkedNullable: Boolean abstract val qualifier: List diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/builder/FirFunctionTypeRefBuilder.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/builder/FirFunctionTypeRefBuilder.kt index e7ed101aa8d..a9330dc6fee 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/builder/FirFunctionTypeRefBuilder.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/builder/FirFunctionTypeRefBuilder.kt @@ -26,6 +26,7 @@ import org.jetbrains.kotlin.fir.visitors.* class FirFunctionTypeRefBuilder : FirAnnotationContainerBuilder { override var source: FirSourceElement? = null override val annotations: MutableList = mutableListOf() + var isSuspend: Boolean by kotlin.properties.Delegates.notNull() var isMarkedNullable: Boolean by kotlin.properties.Delegates.notNull() var receiverTypeRef: FirTypeRef? = null val valueParameters: MutableList = mutableListOf() @@ -35,6 +36,7 @@ class FirFunctionTypeRefBuilder : FirAnnotationContainerBuilder { return FirFunctionTypeRefImpl( source, annotations, + isSuspend, isMarkedNullable, receiverTypeRef, valueParameters, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/builder/FirResolvedFunctionTypeRefBuilder.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/builder/FirResolvedFunctionTypeRefBuilder.kt index 5b8d3f19e9e..8f2b5c6b70c 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/builder/FirResolvedFunctionTypeRefBuilder.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/builder/FirResolvedFunctionTypeRefBuilder.kt @@ -26,6 +26,7 @@ import org.jetbrains.kotlin.fir.visitors.* class FirResolvedFunctionTypeRefBuilder : FirAnnotationContainerBuilder { override var source: FirSourceElement? = null override val annotations: MutableList = mutableListOf() + var isSuspend: Boolean by kotlin.properties.Delegates.notNull() lateinit var type: ConeKotlinType var isMarkedNullable: Boolean by kotlin.properties.Delegates.notNull() var receiverTypeRef: FirTypeRef? = null @@ -36,6 +37,7 @@ class FirResolvedFunctionTypeRefBuilder : FirAnnotationContainerBuilder { return FirResolvedFunctionTypeRefImpl( source, annotations, + isSuspend, type, isMarkedNullable, receiverTypeRef, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/builder/FirResolvedTypeRefBuilder.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/builder/FirResolvedTypeRefBuilder.kt index 3fc23119b4b..81845f21e8d 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/builder/FirResolvedTypeRefBuilder.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/builder/FirResolvedTypeRefBuilder.kt @@ -25,6 +25,7 @@ import org.jetbrains.kotlin.fir.visitors.* class FirResolvedTypeRefBuilder : FirAnnotationContainerBuilder { override var source: FirSourceElement? = null override val annotations: MutableList = mutableListOf() + var isSuspend: Boolean = false lateinit var type: ConeKotlinType var delegatedTypeRef: FirTypeRef? = null @@ -32,6 +33,7 @@ class FirResolvedTypeRefBuilder : FirAnnotationContainerBuilder { return FirResolvedTypeRefImpl( source, annotations, + isSuspend, type, delegatedTypeRef, ) diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirComposedSuperTypeRefImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirComposedSuperTypeRefImpl.kt index f217189009e..0e4e1f66174 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirComposedSuperTypeRefImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirComposedSuperTypeRefImpl.kt @@ -21,6 +21,8 @@ internal class FirComposedSuperTypeRefImpl( override val annotations: MutableList, override val superTypeRefs: MutableList, ) : FirComposedSuperTypeRef() { + override val isSuspend: Boolean = false + override fun acceptChildren(visitor: FirVisitor, data: D) { annotations.forEach { it.accept(visitor, data) } superTypeRefs.forEach { it.accept(visitor, data) } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirDelegatedTypeRefImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirDelegatedTypeRefImpl.kt index c5d46cd33c6..178b4c753eb 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirDelegatedTypeRefImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirDelegatedTypeRefImpl.kt @@ -23,6 +23,7 @@ internal class FirDelegatedTypeRefImpl( ) : FirDelegatedTypeRef() { override val source: FirSourceElement? get() = typeRef.source override val annotations: List get() = typeRef.annotations + override val isSuspend: Boolean = false override fun acceptChildren(visitor: FirVisitor, data: D) { delegate?.accept(visitor, data) diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirDynamicTypeRefImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirDynamicTypeRefImpl.kt index 54a62086e0b..536d2d6a3ef 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirDynamicTypeRefImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirDynamicTypeRefImpl.kt @@ -20,6 +20,8 @@ internal class FirDynamicTypeRefImpl( override val annotations: MutableList, override val isMarkedNullable: Boolean, ) : FirDynamicTypeRef() { + override val isSuspend: Boolean = false + override fun acceptChildren(visitor: FirVisitor, data: D) { annotations.forEach { it.accept(visitor, data) } } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirErrorTypeRefImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirErrorTypeRefImpl.kt index 95c3a11d8d5..e03557624ce 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirErrorTypeRefImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirErrorTypeRefImpl.kt @@ -24,6 +24,7 @@ internal class FirErrorTypeRefImpl( override val diagnostic: ConeDiagnostic, ) : FirErrorTypeRef() { override val annotations: MutableList = mutableListOf() + override val isSuspend: Boolean = false override val type: ConeKotlinType = ConeClassErrorType(diagnostic.reason) override val delegatedTypeRef: FirTypeRef? get() = null diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirFunctionTypeRefImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirFunctionTypeRefImpl.kt index 2dce02fb5ae..30ab129cbf4 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirFunctionTypeRefImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirFunctionTypeRefImpl.kt @@ -21,6 +21,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirFunctionTypeRefImpl( override val source: FirSourceElement?, override val annotations: MutableList, + override val isSuspend: Boolean, override val isMarkedNullable: Boolean, override var receiverTypeRef: FirTypeRef?, override val valueParameters: MutableList, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirImplicitTypeRefImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirImplicitTypeRefImpl.kt index c8eda4c2d94..4b43f1a3814 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirImplicitTypeRefImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirImplicitTypeRefImpl.kt @@ -19,6 +19,7 @@ internal class FirImplicitTypeRefImpl( override val source: FirSourceElement?, ) : FirImplicitTypeRef() { override val annotations: List get() = emptyList() + override val isSuspend: Boolean = false override fun acceptChildren(visitor: FirVisitor, data: D) { } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirResolvedFunctionTypeRefImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirResolvedFunctionTypeRefImpl.kt index 50f6a9ae767..a0443ee0011 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirResolvedFunctionTypeRefImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirResolvedFunctionTypeRefImpl.kt @@ -21,6 +21,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirResolvedFunctionTypeRefImpl( override val source: FirSourceElement?, override val annotations: MutableList, + override val isSuspend: Boolean, override val type: ConeKotlinType, override val isMarkedNullable: Boolean, override var receiverTypeRef: FirTypeRef?, diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirResolvedTypeRefImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirResolvedTypeRefImpl.kt index 9738bb54cac..3c489436769 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirResolvedTypeRefImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/types/impl/FirResolvedTypeRefImpl.kt @@ -20,6 +20,7 @@ import org.jetbrains.kotlin.fir.visitors.* internal class FirResolvedTypeRefImpl( override val source: FirSourceElement?, override val annotations: MutableList, + override val isSuspend: Boolean, override val type: ConeKotlinType, override var delegatedTypeRef: FirTypeRef?, ) : FirResolvedTypeRef() { diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirImplicitBuiltinTypeRef.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirImplicitBuiltinTypeRef.kt index 1a0bd55b35e..240503b1a37 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirImplicitBuiltinTypeRef.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirImplicitBuiltinTypeRef.kt @@ -22,7 +22,8 @@ sealed class FirImplicitBuiltinTypeRef( override val source: FirSourceElement?, val id: ClassId, typeArguments: Array = emptyArray(), - isNullable: Boolean = false + isNullable: Boolean = false, + override val isSuspend: Boolean = false ) : FirResolvedTypeRef() { override val annotations: List get() = emptyList() diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirUserTypeRefImpl.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirUserTypeRefImpl.kt index 601df3e4c2e..220fda1b631 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirUserTypeRefImpl.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirUserTypeRefImpl.kt @@ -19,7 +19,8 @@ open class FirUserTypeRefImpl( override val source: FirSourceElement?, override val isMarkedNullable: Boolean, override val qualifier: MutableList, - override val annotations: MutableList + override val annotations: MutableList, + override val isSuspend: Boolean = false ) : FirUserTypeRef(), FirAnnotationContainer { override fun acceptChildren(visitor: FirVisitor, data: D) { diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/BuilderConfigurator.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/BuilderConfigurator.kt index 2d9e887f7d9..82f9f538626 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/BuilderConfigurator.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/BuilderConfigurator.kt @@ -232,6 +232,7 @@ object BuilderConfigurator : AbstractBuilderConfigurator(FirTree } builder(resolvedTypeRef) { + defaultFalse("isSuspend") defaultNull("delegatedTypeRef") } diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/ImplementationConfigurator.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/ImplementationConfigurator.kt index 747b3d9b8ec..1efeba5cb60 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/ImplementationConfigurator.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/ImplementationConfigurator.kt @@ -376,6 +376,7 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator() withGetter = true } default("annotations", "mutableListOf()") + defaultFalse("isSuspend") useTypes(coneClassErrorTypeType) } @@ -398,12 +399,23 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator() useTypes(errorTypeRefImpl) } - impl(functionTypeRef) - impl(implicitTypeRef) { - defaultEmptyList("annotations") + impl(dynamicTypeRef) { + defaultFalse("isSuspend") } - impl(composedSuperTypeRef) + impl(functionTypeRef) { + // Note that we intentionally do _not_ set default value (false) for `isSuspend`, since function type reference is the only + // place where type modifier `suspend` matters. + } + + impl(implicitTypeRef) { + defaultEmptyList("annotations") + defaultFalse("isSuspend") + } + + impl(composedSuperTypeRef) { + defaultFalse("isSuspend") + } impl(reference, "FirStubReference") { default("source") { @@ -454,6 +466,7 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator() delegate = "typeRef" } } + defaultFalse("isSuspend") } noImpl(userTypeRef) diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/NodeConfigurator.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/NodeConfigurator.kt index 68bf7869df6..b40528c09fc 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/NodeConfigurator.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/NodeConfigurator.kt @@ -530,6 +530,7 @@ object NodeConfigurator : AbstractFieldConfigurator(FirTreeBuild typeRef.configure { +annotations + +booleanField("isSuspend") } resolvedTypeRef.configure {