public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/6336: function local classes name clash (ClassPath)
@ 2002-04-17  7:36 goran
  0 siblings, 0 replies; only message in thread
From: goran @ 2002-04-17  7:36 UTC (permalink / raw)
  To: gcc-gnats

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2151 bytes --]


>Number:         6336
>Category:       java
>Synopsis:       function local classes name clash with other with same name
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 17 07:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        3.1 20020417 (prerelease)
>Organization:
>Environment:
System: Linux cm-linux.lla.sema.se 2.4.17 #8 mån feb 18 17:25:46 CET 2002 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure i686-pc-linux-gnu --prefix=/usr/local/gcc --enable-threads --enable-languages=java --disable-static : (reconfigured)  : (reconfigured)  : (reconfigured) ./configure i686-pc-linux-gnu --prefix=/usr/local/gcc --enable-threads --enable-languages=java --disable-static : (reconfigured)  : (reconfigured) ./configure i686-pc-linux-gnu --prefix=/usr/local/gcc --enable-threads --enable-languages=java --disable-static : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured) ./configure --prefix=/usr/local/gcc --enable-threads --enable-languages=java --disable-static
>Description:
ClassPath from CVS contains code with function local classes
with the same name. This is OK with J2SDK, and it should be.
gcj fails to compile it 

simplified code:
--------------------- snip -------------------------------------
import java.util.Vector;

public class x
{
    void f(Object[] l)
    {
	class x1 
	{
	};
    }
    void f(Vector l)
    {
	class x1 
	{
	};
    }
};
--------------------- snip -------------------------------------

gcj complains:

bash-2.05a$ gcj -c /tmp/x.java 
/tmp/x.java:13: Class `x$x1' already defined in /tmp/x.java:7.
   	class x1 
                 ^

>How-To-Repeat:
Compile the code above (test case)

>Fix:

fix: javac (J2SDK) output classes like from the example:

bash-2.05a$ ls /tmp
x$1$x1.class  x$2$x1.class  x.class  x.java

work-around: rename one instance

>Release-Note:
>Audit-Trail:
>Unformatted:


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

only message in thread, other threads:[~2002-04-17 14:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-17  7:36 java/6336: function local classes name clash (ClassPath) goran

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