Community
Participate
Working Groups
BETA_JAVA8 Tested with 8b115: // -- interface I { int m(); public default int foo() { return 0; } } interface T extends I { public default int m() { I i = I.super::foo; return i.foo(); } } public class X { public static void main(String argv[]) { new T(){}.m(); } } triggers an class format error. JVM does not like the synthetic being a static method.
Thanks in advance for taking a look.
I realized that this has less to with default methods and more to do with reference expression code generation which I worked on. Looks like the combination of static & synthetic is irritating the VM. Part J is not quite categorical about it though. For the case at hand, I am now generating a private synthetic method and having it invoked via MethodHandleRefKindInvokeSpecial. Patch is under test.
Fix and tests available here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=6a493caae74ed7f294c44634abfb786fa2111d3d