see #9576
@@ -307,7 +307,14 @@ module JavaFunctionalInterfaces = struct
jpath = juf,"BiConsumer";
jname = "accept";
jparams = ["T";"U"]
- }
+ };
+ {
+ jargs = [tp "T"];
+ jret = Some (tp "R");
+ jpath = juf,"Function";
+ jname = "apply";
+ jparams = ["T";"R"]
]
let unify jfi args ret =
@@ -0,0 +1,13 @@
+package unit.issues;
+
+class Issue9576 extends Test {
+ #if jvm
+ function test() {
+ eq(6, foo(cast i -> i * 2));
+ }
+ function foo(f:java.util.function.Function<Int, Int>) {
+ return f.apply(3);
+ #end
+}