[FIR] Fix result type of const expressions with expected type

This commit is contained in:
Dmitriy Novozhilov
2019-09-03 16:29:24 +03:00
parent 546bbceeea
commit f8459f8201
@@ -585,7 +585,13 @@ open class FirBodyResolveTransformer(
constExpression.resultType = FirResolvedTypeRefImpl(null, type, emptyList())
} else {
constExpression.resultType = expectedType
constExpression.resultType = if (kind != IrConstKind.Null) {
expectedType.resolvedTypeFromPrototype(
expectedType.coneTypeUnsafe<ConeKotlinType>().withNullability(ConeNullability.NOT_NULL)
)
} else {
expectedType
}
}