From efeabac2c5444d26d5be73bac1e4337cbcb361ee Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Mon, 14 Dec 2020 10:27:05 -0800 Subject: [PATCH] FIR: do not force coercion-to-Unit for nullable lambda return type 3d7d87ac should have been implemented as aafe41c did. --- .../kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt index 617fc230892..56c5d4aa1bc 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArgumentsAnalyzer.kt @@ -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 }