FIR: do not force coercion-to-Unit for nullable lambda return type
3d7d87acshould have been implemented asaafe41cdid.
This commit is contained in:
committed by
Dmitriy Novozhilov
parent
6239301f4e
commit
efeabac2c5
+1
-2
@@ -116,8 +116,7 @@ class PostponedArgumentsAnalyzer(
|
|||||||
c.canBeProper(rawReturnType) -> substitute(rawReturnType)
|
c.canBeProper(rawReturnType) -> substitute(rawReturnType)
|
||||||
|
|
||||||
// For Unit-coercion
|
// For Unit-coercion
|
||||||
c.hasUpperOrEqualUnitConstraint(rawReturnType) ->
|
!rawReturnType.isMarkedNullable && c.hasUpperOrEqualUnitConstraint(rawReturnType) -> unitType
|
||||||
if (rawReturnType.isMarkedNullable) unitType.withNullability(ConeNullability.NULLABLE) else unitType
|
|
||||||
|
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user