return gen fixed

This commit is contained in:
Dmitry Jemerov
2011-04-15 17:34:32 +02:00
parent 3aa9079ea2
commit 0c1fd3269d
@@ -69,7 +69,7 @@ public class FunctionCodegen {
private void generateReturn(MethodVisitor mv, JetExpression bodyExpression, ExpressionCodegen codegen) {
if (!endsWithReturn(bodyExpression)) {
final JetType expressionType = bindingContext.getExpressionType(bodyExpression);
if (expressionType.equals(JetStandardClasses.getUnitType())) {
if (expressionType == null || expressionType.equals(JetStandardClasses.getUnitType())) {
mv.visitInsn(Opcodes.RETURN);
}
else {