Introduce typeRef for FirExpression

This helps both body resolve & conversion to IR
This commit is contained in:
Mikhail Glukhikh
2019-03-21 11:29:08 +03:00
parent adeeeeee48
commit aa6ba1cd4a
29 changed files with 205 additions and 24 deletions
@@ -100,13 +100,13 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn
)
}
FirOperation.AS -> {
bindingContext[resolved] = resolved.typeRef
bindingContext[resolved] = resolved.conversionTypeRef
}
FirOperation.SAFE_AS -> {
bindingContext[resolved] =
resolved.typeRef.withReplacedConeType(
resolved.conversionTypeRef.withReplacedConeType(
session,
resolved.typeRef.coneTypeUnsafe().withNullability(ConeNullability.NULLABLE)
resolved.conversionTypeRef.coneTypeUnsafe().withNullability(ConeNullability.NULLABLE)
)
}
else -> error("Unknown type operator")