Bug 274621 - generic inner class visibility in subclass on Linux
Summary: generic inner class visibility in subclass on Linux
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.4.1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-30 20:26 EDT by Xiaoyang Gu CLA
Modified: 2009-05-14 12:09 EDT (History)
0 users

See Also:


Attachments
The base class and subclass. (577 bytes, application/x-zip-compressed)
2009-04-30 20:31 EDT, Xiaoyang Gu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xiaoyang Gu CLA 2009-04-30 20:26:17 EDT
The attached classes compile fine on Eclipse 3.4.1 on Vista32 JRE 6, but does not compile under Eclipse 3.2 or 3.4.0 on Ubuntu. The classes compile fine with Sun JDK. If generics is removed, then the classes would compile.
Comment 1 Xiaoyang Gu CLA 2009-04-30 20:31:41 EDT
Created attachment 134030 [details]
The base class and subclass.

Somehow the attachment didn't go through.
Comment 2 Walter Harley CLA 2009-04-30 20:39:58 EDT
Reassigning to "Core" since this has nothing to do with APT.

Here are the attached classes, for convenience's sake:

package Experimental;

public class InferenceBase<T extends Comparable<T>>
{
  public class InferenceNode
  {
    T x;
    InferenceNode next;
  }
}

public class InferenceChild<T extends Comparable<T>> extends InferenceBase<T>
{
  public static void main(String[] args)
  {
    return;
  }
	
  public static <E extends Comparable<E>> void test(InferenceChild<E>.InferenceNode a)
  {
    test(a.next);
    return;
 }
}


Xiaoyang, could you please indicate what compiler error you are getting?
Comment 3 Xiaoyang Gu CLA 2009-04-30 21:40:55 EDT
(In reply to comment #2)

No error on javac or Eclipse 3.4.1 on Vista.

The exact error message given by Eclipse 3.4 on Ubunto is the following:

>     test(a.next);
^^^^^^^^^^Bound mismatch: The generic method test(InferenceChild<E>.InferenceNode) of type InferenceChild<T> is not applicable for the arguments (InferenceBase<T>.InferenceNode). The inferred type Comparable<Comparable<E>> is not a valid substitute for the bounded parameter <E extends Comparable<E>>

Comment 4 Kent Johnson CLA 2009-05-05 14:20:58 EDT
So a bug was fixed in 3.4.1.

The eclipse compiler (since 3.4.1) no longer produces an error in this case, just as javac does not.


Please reopen if we missed something.
Comment 5 Frederic Fusier CLA 2009-05-14 12:09:08 EDT
(In reply to comment #3)
> 
> No error on javac or Eclipse 3.4.1 on Vista.
> 
Verified by reporter