Bug 159893 - [compiler] Compilation Error with nested classes
Summary: [compiler] Compilation Error with nested classes
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-05 11:39 EDT by Francesco CLA
Modified: 2006-10-30 12:00 EST (History)
0 users

See Also:


Attachments
Proposed patch (6.46 KB, patch)
2006-10-25 07:15 EDT, Philipe Mulet CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Francesco CLA 2006-10-05 11:39:43 EDT
Overview Description: 
Compile error with nested classes and private public methods naem conflict

#Steps to Reproduce: 
 >> create the following class 

public abstract  class B {
  public String getValue(){
    return "pippo";
  }
}

>> create the following class 


public class D {
  private String value;
  public D(String p_Value){
    value= p_Value;
  }
  private  String getValue(){
    return "pippoD";
  }
}

>> create this class 

public class A extends B {
  // do something 
  class C extends D{
    public C() {
      super(getValue());
    }
  }
}


#Actual Results: 
  compilation error: "the method getValue() from type D is not visible"
#Expected Results: 
  should use the getValue() of class D 

#Build Date & Platform: 
Eclipse SDK
Version: 3.2.1
Build id: M20060921-0945

# NOTE: It was working a week ago more or less, it think that is due to the automatic update set on my eclipse profile.
Comment 1 Francesco CLA 2006-10-05 11:45:06 EDT
workaround: explict reference to the desired method
Comment 2 Olivier Thomann CLA 2006-10-06 16:37:24 EDT
Reproduced with HEAD.
Seems to be an issue with 1.4 and 1.5.
Comment 3 Philipe Mulet CLA 2006-10-25 04:39:30 EDT
Reproduced.
Comment 4 Philipe Mulet CLA 2006-10-25 04:40:49 EDT
This is the case where we should keep looking outside, after we found a non-visible match.

Here we should complain that we find no method.

class D {
  private String value;
  public D(String p_Value){
    value = p_Value;
  }
  private  String getValue(){
    return "pippoD";
  }
}
public class X {
  class C extends D{
    public C() {
      super(getValue());
      String s = getValue();
    }
  }
}
Comment 5 Philipe Mulet CLA 2006-10-25 07:15:24 EDT
Created attachment 52660 [details]
Proposed patch
Comment 6 Philipe Mulet CLA 2006-10-25 07:16:21 EDT
Tuned implicit lookup semantics.
Added LookupTest#test077,078.

Released for 3.3M3
Fixed
Comment 7 David Audel CLA 2006-10-30 12:00:46 EST
Verified for 3.3 M3 using build I20061030-0010