java/2332: valid declaration rejected
Tue Mar 20 13:46:00 GMT 2001

>Number:         2332
>Category:       java
>Synopsis:       valid declaration rejected
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 20 13:46:02 PST 2001
>Originator:     Tom Tromey
>Release:        unknown-1.0

This ugly example is derived from the Apache javax.servlet
public class foo {
  Object[][] vals;

  public foo (Object[] v[])
    vals = v;

I believe this is valid (if hideous) Java code.
However gcj rejects it:

creche. gcj --syntax-only In class `foo': In method `(java.lang.Object[])': Incompatible type for `='. Explicit cast needed to convert `java.lang.Object[]' to `java.lang.Object[][]'.
       vals = v;
1 error

I looked at this bug once and came to the conclusion
that gcj thought `v' was of type `Object[]'.



More information about the Gcc-bugs mailing list