Wrap Nothing type into return expression
This commit is contained in:
committed by
Dmitry Petrov
parent
5121fcb287
commit
d6b5e48b2a
@@ -105,12 +105,7 @@ class BodyGenerator(val scopeOwner: DeclarationDescriptor, override val context:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun IrExpression.wrapWithReturn() =
|
private fun IrExpression.wrapWithReturn() = generateReturnExpression(startOffset, endOffset, this)
|
||||||
if (KotlinBuiltIns.isNothing(type))
|
|
||||||
this
|
|
||||||
else {
|
|
||||||
generateReturnExpression(startOffset, endOffset, this)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun generateReturnExpression(startOffset: Int, endOffset: Int, returnValue: IrExpression): IrReturnImpl {
|
private fun generateReturnExpression(startOffset: Int, endOffset: Int, returnValue: IrExpression): IrReturnImpl {
|
||||||
val returnTarget = (scopeOwner as? CallableDescriptor) ?:
|
val returnTarget = (scopeOwner as? CallableDescriptor) ?:
|
||||||
|
|||||||
Reference in New Issue
Block a user