Fix up functional interface
This commit is contained in:
parent
f95c3c5fcf
commit
3d2c699964
@ -195,7 +195,7 @@ public class StatementToTargetExpression implements ASTVisitor {
|
||||
var thisMethod = converter.findMethod(converter.currentClass, methodCall.name, signature);
|
||||
foundMethod = thisMethod.orElseGet(() -> findMethod(converter.currentClass.getSuperClass().getName(), methodCall.name, signature).orElseThrow());
|
||||
} else if (!isFunNType) {
|
||||
System.out.println(methodCall.signature);
|
||||
receiverClass = converter.compiler.getClass(receiverName);
|
||||
foundMethod = findMethod(receiverName, methodCall.name, signature).orElseThrow();
|
||||
}
|
||||
|
||||
|
@ -751,8 +751,8 @@ public class TestComplete {
|
||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "FunctionalInterface.jav");
|
||||
var clazz = classFiles.get("FunctionalInterface");
|
||||
var instance = clazz.getDeclaredConstructor().newInstance();
|
||||
var m = clazz.getDeclaredMethod("m", Integer.class);
|
||||
assertEquals(m.invoke(instance, 20), 400);
|
||||
var m = clazz.getDeclaredMethod("m");
|
||||
assertEquals(m.invoke(instance), 200);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user