This is the mail archive of the
java-prs@sources.redhat.com
mailing list for the Java project.
gcj/299: wrong error message when trying to access outer field from inner static class
- To: java-gnats at sourceware dot cygnus dot com
- Subject: gcj/299: wrong error message when trying to access outer field from inner static class
- From: osk at hem dot passagen dot se
- Date: 4 Aug 2000 13:53:25 -0000
- Reply-To: osk at hem dot passagen dot se
- Resent-Cc: java-prs at sourceware dot cygnus dot com, green at cygnus dot com
- Resent-Reply-To: java-gnats@sourceware.cygnus.com, osk@hem.passagen.se
>Number: 299
>Category: gcj
>Synopsis: wrong error message when trying to access outer field from inner static class
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: apbianco
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Aug 04 07:00:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Oskar Liljeblad
>Release: unknown-1.0
>Organization:
>Environment:
>Description:
(I hope this is not old)
Compiling the code below prints this error:
$ gcj -C LinkedList.java
LinkedList.java: In class `LinkedList$Iter':
LinkedList.java: In method `LinkedList$Iter()':
LinkedList.java:11: Undefined variable or class name: `this$0'.
}
^
1 error
$
It should probably print something like this:
"Can't make a static reference to nonstatic variable `modCount' in class `LinkedList'."
>How-To-Repeat:
public class LinkedList {
public int modCount = 0;
static class Iter {
Iter() {
int dumb = modCount;
}
}
public void foo() {
new Iter();
}
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: