This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
java/4695: Error calling method from enclosing context in constructor
- To: gcc-gnats at gcc dot gnu dot org
- Subject: java/4695: Error calling method from enclosing context in constructor
- From: bryce at gcc dot gnu dot org
- Date: 26 Oct 2001 03:08:23 -0000
- Reply-To: bryce at gcc dot gnu dot org
>Number: 4695
>Category: java
>Synopsis: Error calling method from enclosing context in constructor
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Oct 25 20:16:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Bryce McKinlay
>Release: trunk
>Organization:
>Environment:
>Description:
Another test case distilled from classpath's TreeMap.
GCJ reports: EnclosingCall.java:12: Can't reference `this' before the superclass constructor has been called.
... but we don't need to access this to call foo() - only this$0.
>How-To-Repeat:
public class EnclosingCall
{
int foo()
{
return 5;
}
class Inner
{
Inner()
{
this(foo());
}
Inner (int i)
{
}
}
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: