FIR: Do not fail on not calculated type

This commit is contained in:
Simon Ogorodnik
2019-03-21 17:32:21 +03:00
parent 70e324277e
commit 85a096029c
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.fir.scopes.processClassifiersByNameWithAction
import org.jetbrains.kotlin.fir.service
import org.jetbrains.kotlin.fir.symbols.*
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
import org.jetbrains.kotlin.fir.types.ConeKotlinErrorType
import org.jetbrains.kotlin.fir.types.ConeKotlinType
import org.jetbrains.kotlin.fir.types.FirTypeRef
import org.jetbrains.kotlin.fir.types.coneTypeUnsafe
@@ -207,7 +208,7 @@ fun createSimpleConsumer(
ExplicitReceiverTowerDataConsumer(session, name, token, object : ReceiverValueWithPossibleTypes {
override val type: ConeKotlinType
get() = explicitReceiverType?.coneTypeUnsafe()
?: throw AssertionError("No type calculated for ${explicitReceiver.renderWithType()}")
?: ConeKotlinErrorType("No type calculated for: ${explicitReceiver.renderWithType()}") // TODO: assert here
}, callKind)
} else {
NoExplicitReceiverTowerDataConsumer(session, name, token, callKind)