Support Nothing return type

This commit is contained in:
Michael Bogdanov
2016-09-30 13:52:59 +03:00
committed by Dmitry Petrov
parent 24863a84c4
commit 607cf4c86d
@@ -192,6 +192,11 @@ class ExpressionCodegen(
} else {
(callable as CallableMethod).genInvokeDefaultInstruction(mv)
}
val returnType = expression.descriptor.returnType
if (returnType != null && KotlinBuiltIns.isNothing(returnType)) {
mv.aconst(null)
mv.athrow()
}
return StackValue.onStack(callable.returnType)
}
}