Commit 5ec200c
committed
Add support for lambdas with implicit boxing
Turns out the usual lambda metafactory can apply boxing/unboxing, so you might see a situation like
int myMethod(int i) { ... }
interface MyLambdaType { Integer f(Integer i); }
MyLambdaType mlt = SomeType::myMethod;
And contrary to my prior expectations, the compiler doesn't generate a method stub to do the type conversion,
it just directly requests an invokestatic lambda pointed at myMethod, regardless of the int vs. Integer clash.
The lambda metafactory (which re-implement in JBMC) is then responsible for adding the necessary conversions.1 parent d58ebd8 commit 5ec200c
File tree
29 files changed
+445
-6
lines changed- jbmc
- regression/jbmc/lambda-boxing
- src/java_bytecode
29 files changed
+445
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 commit comments