Summary: | error on valid java code from freenet | ||
---|---|---|---|
Product: | gcc | Reporter: | Ruben Garcia <ruben> |
Component: | java | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs, java-prs |
Priority: | P2 | Keywords: | rejects-valid |
Version: | 3.4.2 | ||
Target Milestone: | 4.3.0 | ||
Host: | Target: | i686-pc-linux-gnu | |
Build: | i686-pc-linux-gnu | Known to work: | |
Known to fail: | 4.0.0 3.4.3 | Last reconfirmed: | 2004-09-27 13:27:55 |
Bug Depends on: | 28067 | ||
Bug Blocks: | 18131 | ||
Attachments: | Test case (with int x() in both A and B) |
Description
Ruben Garcia
2004-09-27 12:36:11 UTC
Created attachment 7224 [details]
Test case (with int x() in both A and B)
Confirmed. A workaround is to change B.super.x() to just super.x(). The workaround does not work when in an inner class. This was the original problem. >cat a.java class A { int x() { return 0; } } class B extends A { int x(){ return 1; } class C { int y(){ return B.super.x(); } } } >javac a.java #no error >gcj a.java a.java:13: error: 'class' or 'this' expected. return B.super.x(); ^ 1 error (In reply to comment #4) This might be a completely unrelated bug; at least the error message is different. Then a workaround is: class A { int x() { return 0; } } class B extends A { int x() { return 1; } // Extra workaround method int ax() { return super.x(); } class C { int y() { return ax(); } } } But this is getting silly indeed. It is a real bug that mist be fixed. All gcj front end bugs have been fixed by the gcj-eclipse branch merge. I'm mass-closing the affected PRs. If you believe one of these was closed in error, please reopen it with a note explaining why. Thanks. |