public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/1295: bogus error for inner class "Class.this.method"
@ 2000-12-20 12:24 osk
  0 siblings, 0 replies; only message in thread
From: osk @ 2000-12-20 12:24 UTC (permalink / raw)
  To: java-gnats

>Number:         1295
>Category:       java
>Synopsis:       bogus error for inner class "Class.this.method"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:18:49 PST 2000
>Closed-Date:    Thu Dec 14 20:33:26 PST 2000
>Last-Modified:  Thu Dec 14 20:40:00 PST 2000
>Originator:     Oskar Liljeblad
>Release:        unknown-1.0
>Organization:
>Environment:
Debian GNU/Linux
GNU libc 2.1.3
gcc 2.96 snapshot 20000612
libgcj snapshot 2000-06-18
>Description:
Compiling the attached class with gcj gives:

  $ gcj -c Test.java
  Test.java: In class `Test$1':
  Test.java: In method `paint()':
  Test.java:14: No case for tree code `identifier_node' - java_complete_tree
  $ javac Test.java
  $

The error is also reported for line 15 (Component.this.getSize()) in
the source.

Oskar Liljeblad (osk@hem.passagen.se)

Test.java:
class Component {
	public int getSize() { return 0; }
}

class Canvas extends Component {
	public int getSize() { return 1; }
}

public class Test extends Component {
	public Test() {
		new Canvas() {
			public void paint() {
				int foo1 = getSize();
				int foo2 = Canvas.this.getSize();
				int foo3 = Component.this.getSize();
			}
		};
	}
}
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

Formerly PR gcj/274

State-Changed-From-To: open->closed
State-Changed-By: bryce
State-Changed-When: Thu Dec 14 20:33:26 2000
State-Changed-Why:
    This has been fixed in the current cvs. 
    Compiling your test case, I get:
    
    $ gcj -c Component.java 
    Component.java: In class `Test$1':
    Component.java: In method `paint()':
    Component.java:15: Can't use variable `Canvas.this': type `Canvas' isn't an outer type of type `Test$1'.
                          int foo2 = Canvas.this.getSize();
                                     ^
    Component.java:16: Can't use variable `Component.this': type `Component' isn't an outer type of type `Test$1'.
                          int foo3 = Component.this.getSize();
                                     ^
    2 errors
    
    which I believe is the correct error.

From: bryce@albatross.co.nz
To: apbianco@cygnus.com, java-gnats@sourceware.cygnus.com, osk@hem.passagen.se
Cc:  
Subject: Re: gcj/274
Date: 15 Dec 2000 04:33:26 -0000

 Synopsis: bogus error for inner class "Class.this.method"
 
 State-Changed-From-To: open->closed
 State-Changed-By: bryce
 State-Changed-When: Thu Dec 14 20:33:26 2000
 State-Changed-Why:
     This has been fixed in the current cvs. 
     Compiling your test case, I get:
     
     $ gcj -c Component.java 
     Component.java: In class `Test$1':
     Component.java: In method `paint()':
     Component.java:15: Can't use variable `Canvas.this': type `Canvas' isn't an outer type of type `Test$1'.
                           int foo2 = Canvas.this.getSize();
                                      ^
     Component.java:16: Can't use variable `Component.this': type `Component' isn't an outer type of type `Test$1'.
                           int foo3 = Component.this.getSize();
                                      ^
     2 errors
     
     which I believe is the correct error.
 
 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=274&database=java
>Unformatted:



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-20 12:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:24 java/1295: bogus error for inner class "Class.this.method" osk

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).