Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 421797 - [1.8][compiler] ClassFormatError with default methods & I.super::foo syntax
Summary: [1.8][compiler] ClassFormatError with default methods & I.super::foo syntax
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: BETA J8   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 380501
  Show dependency tree
 
Reported: 2013-11-15 01:35 EST by Srikanth Sankaran CLA
Modified: 2013-11-15 03:59 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2013-11-15 01:35:57 EST
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.
Comment 1 Srikanth Sankaran CLA 2013-11-15 01:36:27 EST
Thanks in advance for taking a look.
Comment 2 Srikanth Sankaran CLA 2013-11-15 03:36:26 EST
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.