Very simple strange bug

Martin Kahlert
Wed Feb 21 06:28:00 GMT 2001

I simplified my bugreport (gnats: java/2008) even more:


public class buggy
 public static void main(String[] args)
     String s[] = new String[1];

     s[0]  =  "";
     s[0] +=  "";

gcj -c In class `buggy': In method `buggy.main(java.lang.String[])': Tree check: expected class 'e', have 'd' (function_decl) confused by earlier errors, bailing out

It is neccessary, that s is an array of strings. A simple String works.

If you change 
s[0] +=  "";
s[0] =  s[0] + "";
it works, too.


gcj -v:
Reading specs from /sw/gcc-3/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Reading specs from
rename spec lib to liborig
rename spec startfile to startfileorig
Configured with: ../configure --prefix=/sw/gcc-3
--enable-languages=c++,f77,java --enable-threads=posix
gcc version 3.0 20010221 (prerelease)


The early bird gets the worm. If you want something else for       
breakfast, get up later.

More information about the Java mailing list