FIR: fix return statement generation for Unit-returning lambdas...
for case then the expected return type is not Unit. #KT-56747 fixed
This commit is contained in:
committed by
Space Team
parent
505edb9746
commit
aa3c189d83
@@ -65,7 +65,7 @@ fun FirAnonymousFunction.addReturnToLastStatementIfNeeded() {
|
||||
if (lastStatement is FirReturnExpression) return
|
||||
|
||||
val returnType = (body.typeRef as? FirResolvedTypeRef) ?: return
|
||||
if (returnType.isNothing || returnType.isUnit) return
|
||||
if (returnType.isNothing) return
|
||||
|
||||
val returnTarget = FirFunctionTarget(null, isLambda = isLambda).also { it.bind(this) }
|
||||
val returnExpression = buildReturnExpression {
|
||||
|
||||
Reference in New Issue
Block a user