public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: java/4695: Error calling method from enclosing context in constructor
@ 2003-05-12 19:28 Dara Hazeghi
  0 siblings, 0 replies; 2+ messages in thread
From: Dara Hazeghi @ 2003-05-12 19:28 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR java/4695; it has been noted by GNATS.

From: Dara Hazeghi <dhazeghi@yahoo.com>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: java/4695: Error calling method from enclosing context in constructor
Date: Mon, 12 May 2003 11:29:36 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=4695
 
 Hello,
 
 I can verify that on 3.2, 3.3 branch and mainline (20030510) on  
 i686-linux, the same error occurs:
 EnclosingCall.java: In class `EnclosingCall$Inner':
 EnclosingCall.java: In constructor `(EnclosingCall)':
 EnclosingCall.java:12: error: Can't reference `this' before the  
 superclass constructor has been called.
         this(foo());
              ^
 1 error
 
 Dara
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* java/4695: Error calling method from enclosing context in constructor
@ 2001-10-25 20:16 bryce
  0 siblings, 0 replies; 2+ messages in thread
From: bryce @ 2001-10-25 20:16 UTC (permalink / raw)
  To: gcc-gnats

>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:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-12 19:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-12 19:28 java/4695: Error calling method from enclosing context in constructor Dara Hazeghi
  -- strict thread matches above, loose matches on Subject: below --
2001-10-25 20:16 bryce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).