This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

java/2358: Inner class extending another in package: Can't find method



>Number:         2358
>Category:       java
>Synopsis:       Inner class extending another in package: Can't find method
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 23 06:36:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Vegard B. Havdal
>Release:        prerelease 20010320
>Organization:
>Environment:
RH6.2
>Description:
The classes One, Another and Yetanother compile with SUN javac,
but gcj -C says:
tull/One.java: In class `tull.Another':
tull/One.java: In method `tull.Another.toString()':
tull/One.java:11: Can't find method `toString()' in type `'. Candidates are:
  `tull.Another.toString()' in `tull.Another'
  `tull.One.toString()' in `tull.One'.
       return y.toString();
               ^
1 error
>How-To-Repeat:
package tull;
class One {
  public String toString() {
    return "foo";
  }
}

class Another {
  Another.Yetanother y;
  public String toString() {
    return y.toString();
  }
  public static class Yetanother extends One {
  }
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]