[FIR] Store fir for invalid when branches
^KTIJ-25646 fixed Merge-request: KT-MR-10646 Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ internal class FirWhenSubjectExpressionImpl(
|
||||
override var annotations: MutableOrEmptyList<FirAnnotation>,
|
||||
override val whenRef: FirExpressionRef<FirWhenExpression>,
|
||||
) : FirWhenSubjectExpression() {
|
||||
override val typeRef: FirTypeRef get() = whenRef.value.subject!!.typeRef
|
||||
override val typeRef: FirTypeRef get() = whenRef.value.subject?.typeRef ?: org.jetbrains.kotlin.fir.types.impl.FirImplicitUnitTypeRef(source)
|
||||
|
||||
override fun <R, D> acceptChildren(visitor: FirVisitor<R, D>, data: D) {
|
||||
annotations.forEach { it.accept(visitor, data) }
|
||||
|
||||
+1
-1
@@ -418,7 +418,7 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
|
||||
impl(whenSubjectExpression) {
|
||||
default("typeRef") {
|
||||
value = "whenRef.value.subject!!.typeRef"
|
||||
value = "whenRef.value.subject?.typeRef ?: org.jetbrains.kotlin.fir.types.impl.FirImplicitUnitTypeRef(source)"
|
||||
withGetter = true
|
||||
}
|
||||
useTypes(whenExpression)
|
||||
|
||||
Reference in New Issue
Block a user