JVM: do not assume that methods have body in BridgeLowering
They don't have bodies in the kapt stub generation mode. #KT-58787 Fixed
This commit is contained in:
committed by
Space Team
parent
b2230327df
commit
d32268c5cb
+5
-4
@@ -539,10 +539,11 @@ internal class BridgeLowering(val context: JvmBackendContext) : FileLoweringPass
|
||||
}
|
||||
|
||||
// After the checks, insert the original method body.
|
||||
if (body is IrExpressionBody) {
|
||||
+irReturn((body as IrExpressionBody).expression)
|
||||
} else {
|
||||
(body as IrBlockBody).statements.forEach { +it }
|
||||
when (val body = body) {
|
||||
is IrExpressionBody -> +irReturn(body.expression)
|
||||
is IrBlockBody -> body.statements.forEach { +it }
|
||||
null -> {}
|
||||
else -> error("Unsupported method body kind: ${body.render()}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user