[K/N] Handle Unit? and Nothing? correctly in finally transformation
^KT-52985
This commit is contained in:
+2
-3
@@ -267,9 +267,8 @@ class FinallyBlocksLowering(val context: CommonBackendContext, private val throw
|
||||
value: IrExpression,
|
||||
finallyExpression: IrExpression
|
||||
): IrExpression {
|
||||
val returnTypeClassifier = (type as? IrSimpleType)?.classifier
|
||||
return when (returnTypeClassifier) {
|
||||
context.irBuiltIns.unitClass, context.irBuiltIns.nothingClass -> irBlock(value, null, type) {
|
||||
return when {
|
||||
type.isUnit() || type.isNothing() -> irBlock(value, null, type) {
|
||||
+irReturnableBlock(symbol, type) {
|
||||
+value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user