java/1309: Cannot refer to inner static class
osk@hem.passagen.se
osk@hem.passagen.se
Wed Dec 20 12:24:00 GMT 2000
>Number: 1309
>Category: java
>Synopsis: Cannot refer to inner static class
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 20 12:18:53 PST 2000
>Closed-Date: Tue Aug 15 21:27:43 PDT 2000
>Last-Modified: Tue Aug 15 21:30:00 PDT 2000
>Originator: osk@hem.passagen.se
>Release: unknown-1.0
>Organization:
>Environment:
egcs 2000-07-17
libgcj 2000-07-18
>Description:
(This might be old, but I couldn't find any matching PRs.)
Compiling the following code
class Outer {
public static class InnerStatic { }
}
class Test {
public void method() {
Outer.InnerStatic[] i;
}
}
with gcj snapshot 20000717 gives this error:
$ gcj -C Test.java
Test.java:7: Type `Outer.InnerStatic' not found in the declaration of
the local variable `i'.
Outer.InnerStatic[] i;
^
1 error
while jikes compiles it just fine.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Formerly PR gcj/288
From: Mark Wielaard <mark@klomp.org>
To: osk@hem.passagen.se
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/288: Cannot refer to inner static class
Date: Wed, 19 Jul 2000 14:07:07 +0200
Hi,
Note that as a workaround you can write Outer$InnerStatic.
Mark
From: Tom Tromey <tromey@cygnus.com>
To: osk@hem.passagen.se
Cc: java-gnats@sourceware.cygnus.com, "a. pbianco" <apbianco@cygnus.com>
Subject: Re: gcj/288: Cannot refer to inner static class
Date: Wed, 19 Jul 2000 05:20:02 -0700 (PDT)
Alex, this is the primary bug I'm seeing with my AWT patch.
Tom
From: Bryce McKinlay <bryce@albatross.co.nz>
To: osk@hem.passagen.se, java-gnats@sourceware.cygnus.com
Cc:
Subject: Re: gcj/288: Cannot refer to inner static class
Date: Thu, 20 Jul 2000 14:49:03 +1200
osk@hem.passagen.se wrote:
> $ gcj -C Test.java
> Test.java:7: Type `Outer.InnerStatic' not found in the declaration of
> the local variable `i'.
> Outer.InnerStatic[] i;
> ^
> 1 error
Yeah, this is basically the same as gcj/257.
Any type resolution that goes through resolve_type_during_patch() doesn't
seem to be working with inner classes. These are array type declarations,
casts, dot-class expressions, and instanceof expressions.
Note that in this case your example should be legal even if
Outer.InnerStatic wasn't static (but not if it is private).
regards
[ bryce ]
State-Changed-From-To: open->closed
State-Changed-By: bryce
State-Changed-When: Tue Aug 15 21:27:43 2000
State-Changed-Why:
This was fixed along with PR 256/257. It works fine for me now.
From: bryce@albatross.co.nz
To: apbianco@cygnus.com, java-gnats@sourceware.cygnus.com, osk@hem.passagen.se
Cc:
Subject: Re: gcj/288
Date: 16 Aug 2000 04:27:43 -0000
Synopsis: Cannot refer to inner static class
State-Changed-From-To: open->closed
State-Changed-By: bryce
State-Changed-When: Tue Aug 15 21:27:43 2000
State-Changed-Why:
This was fixed along with PR 256/257. It works fine for me now.
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=288&database=java
>Unformatted:
More information about the Gcc-prs
mailing list