FIR: do not force coercion-to-Unit for nullable lambda return type

3d7d87ac should have been implemented as aafe41c did.
This commit is contained in:
Jinseong Jeon
2020-12-14 10:27:05 -08:00
committed by Dmitriy Novozhilov
parent 6239301f4e
commit efeabac2c5
@@ -116,8 +116,7 @@ class PostponedArgumentsAnalyzer(
c.canBeProper(rawReturnType) -> substitute(rawReturnType)
// For Unit-coercion
c.hasUpperOrEqualUnitConstraint(rawReturnType) ->
if (rawReturnType.isMarkedNullable) unitType.withNullability(ConeNullability.NULLABLE) else unitType
!rawReturnType.isMarkedNullable && c.hasUpperOrEqualUnitConstraint(rawReturnType) -> unitType
else -> null
}