This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
java/1970: Can't instantiate local class in static method
- To: gcc-gnats at gcc dot gnu dot org
- Subject: java/1970: Can't instantiate local class in static method
- From: bryce at albatross dot co dot nz
- Date: 14 Feb 2001 02:28:59 -0000
- Reply-To: bryce at albatross dot co dot nz
>Number: 1970
>Category: java
>Synopsis: Can't instantiate local class in static method
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Feb 13 18:36:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Bryce McKinlay
>Release: gcc version 2.97 20010207 (experimental)
>Organization:
>Environment:
>Description:
Try to compile the test case below.
gcj reports:
$ gcj -c StaticLocal.java
StaticLocal.java: In class `StaticLocal':
StaticLocal.java: In method `StaticLocal.a()':
StaticLocal.java:7: No enclosing instance for inner class `StaticLocal$Foo' is in scope.
new Foo();
^
1 error
>How-To-Repeat:
class StaticLocal
{
static void a()
{
class Foo {}
new Foo();
}
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: