Generate return when generating continuation class for expression body
Otherwise, the function will return Unit instead of correct value. #KT-46007 Fixed
This commit is contained in:
committed by
TeamCityServer
parent
539d3e5df2
commit
1c48fb28db
+6
-2
@@ -316,8 +316,12 @@ private class AddContinuationLowering(context: JvmBackendContext) : SuspendLower
|
||||
function as IrAttributeContainer,
|
||||
flag.capturesCrossinline
|
||||
)
|
||||
for (statement in newFunction.body!!.statements) {
|
||||
+statement
|
||||
if (newFunction.body is IrExpressionBody) {
|
||||
+irReturn(newFunction.body!!.statements[0] as IrExpression)
|
||||
} else {
|
||||
for (statement in newFunction.body!!.statements) {
|
||||
+statement
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user