Skip to content

Commit b11c1ff

Browse files
committed
Fix function return types not working for non interface types
1 parent ba8fadc commit b11c1ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

JavaBytecodeCompiler/src/main/java/org/openzen/zenscript/javabytecode/compiler/JavaExpressionVisitor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,10 @@ public Void visitCall(CallExpression expression) {
11961196
break;
11971197
}
11981198
case FUNCTION_CALL:
1199-
javaWriter.invokeInterface(context.getFunctionalInterface(expression.target.type));
1199+
FunctionTypeID expressionType = (FunctionTypeID) expression.target.type;
1200+
JavaMethod functionalInterface = context.getFunctionalInterface(expressionType);
1201+
javaWriter.invokeInterface(functionalInterface);
1202+
handleReturnValue(context.getFunction(expressionType).getHeader().getReturnType(), expression.instancedHeader.getReturnType());
12001203
break;
12011204
default:
12021205
throw new UnsupportedOperationException("Unknown builtin: " + builtin);

0 commit comments

Comments
 (0)