Bug 279182 - [1.5][compiler] Anon types can't reference outer covariant methods with the <Outer class name>.this.<method> idiom
Summary: [1.5][compiler] Anon types can't reference outer covariant methods with the <...
Status: VERIFIED NOT_ECLIPSE
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 RC4   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-04 19:38 EDT by Hollis Waite CLA
Modified: 2009-06-05 15:20 EDT (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 Hollis Waite CLA 2009-06-04 19:38:32 EDT
Build ID: I20090522-1710

Steps To Reproduce:
public abstract class AbstractTest {public abstract Object m();}
--
public interface InterfaceTest {Integer m();}
--
public abstract class AbstractSubTest extends AbstractTest implements InterfaceTest {
  Object mO = new Object() {void m2() {AbstractSubTest.this.m();}};
}


More information:
Won't compile in JDK 1.6.0_14-b08: AbstractSubTest.java:4: reference to m is ambiguous, both method m() in AbstractTest and method m() in InterfaceTest match
  Object mO = new Object() {void m2() {AbstractSubTest.this.m();}};

As is often the case, Eclipse's behavior seems preferable.  Maybe it's really a Java bug.
Comment 1 Kent Johnson CLA 2009-06-05 12:07:58 EDT
> Won't compile in JDK 1.6.0_14-b08

but it does compile with the version 7 beta (May 14th)

I believe this is a javac bug that is fixed in the version 7 stream
Comment 2 Olivier Thomann CLA 2009-06-05 15:20:05 EDT
Verified for 3.5RC4.