public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/19707] New: Non-final variable doesn't shadow field wrt inner class.
@ 2005-01-30  9:45 kon at iki dot fi
  2005-01-30 14:22 ` [Bug java/19707] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: kon at iki dot fi @ 2005-01-30  9:45 UTC (permalink / raw)
  To: java-prs

A GCC checked out from CVS on 2005-01-29 compiles the following
code without complaint, generating a g() that accesses Outer.x:

class Outer {
    int x;
    void f(Object x) {
        class Inner {
            int g() {
                return x;
            }
        }
    }
}

The parameter with the same name should shadow the field, and GCC
should then report an error because the parameter is not final
and even has the wrong type.

$ gcj -v -C nonfinal-shadow.java
Using built-in specs.
Configured with: /home/kalle/src/FOREIGN-CVS/gcc/configure --prefix=/home/kalle
--exec-prefix=/home/kalle/i386-pc-linux-gnu --host=i386-pc-linux-gnu
--build=i386-pc-linux-gnu
Thread model: posix
gcc version 4.0.0 20050129 (experimental)

/home/kalle/stow/gcc/i386-pc-linux-gnu/bin/../libexec/gcc/i386-pc-linux-gnu/4.0.0/jc1 nonfinal-shadow.java -quiet -dumpbase nonfinal-shadow.java -auxbase-strip
NONE -g1 -version -fsyntax-only -femit-class-files -o /dev/null
GNU Java version 4.0.0 20050129 (experimental) (i386-pc-linux-gnu)
	compiled by GNU C version 4.0.0 20050103 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Class path starts here:
    ./
   
/home/kalle/stow/gcc/i386-pc-linux-gnu/bin/../lib/gcc/../../../share/java/libgcj-4.0.0.jar/ (system) (zip)

-- 
           Summary: Non-final variable doesn't shadow field wrt inner class.
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kon at iki dot fi
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
 GCC build triplet: i386-pc-linux-gnu
  GCC host triplet: i386-pc-linux-gnu
GCC target triplet: i386-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19707


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

* [Bug java/19707] Non-final variable doesn't shadow field wrt inner class.
  2005-01-30  9:45 [Bug java/19707] New: Non-final variable doesn't shadow field wrt inner class kon at iki dot fi
@ 2005-01-30 14:22 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-30 14:22 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-30 14:22 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |18131
              nThis|                            |
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |accepts-invalid
   Last reconfirmed|0000-00-00 00:00:00         |2005-01-30 14:22:48
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19707


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

end of thread, other threads:[~2005-01-30 14:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-30  9:45 [Bug java/19707] New: Non-final variable doesn't shadow field wrt inner class kon at iki dot fi
2005-01-30 14:22 ` [Bug java/19707] " pinskia at gcc dot gnu dot org

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