Date: Fri, 30 May 2003 17:24:13 -0400 (EDT)
From: C. Scott Ananian
To: jsr14-prototype-comments@sun.com
Subject: Oddities in multi-dim array variance.
Why are the classfile signature strings for
Number[+][=]
and
Number[=][+]
identical?
The fact that this typechecks is probably related:
Number[-][=] na4 = new Number[1][-];
Is this correct? I've always assumed that the constructor and the
declaration mirrored each other; that is, that the 'first' brackets in the
declaration corresponded to the 'first' brackets in the constructor; that
is, corresponded to the 'outermost' array (the array with elements of type
"array of Number"). In any case, *one of* these statements should not
type check (although both do, in the 2.0 prototype):
void foo(Number[=][+] na1, Number[+][=] na2) {
na1[0] = new Number[1];
na2[0] = new Number[1];
}
Also unclear is the interaction with dynamic arrays. This typechecks:
Number[=][] n0 = new Number[1][];
{ n0[0] = new Number[1];
n0[0] = new Integer[1];
n0[0][0] = new Float(0.0);
}
So I'm assuming this is parsed as a static array of dynamic arrays.
So why isn't this allowed?
Number[+][] = new Integer[1][];
Finally, it is interesting that the signature generated for this
declaration:
Number[+][=][+] nd0/* = new Number[1][1][1]*/;
is:
[=[+[+Ljava/lang/Number;
That surely is not correct.
--scott
cracking Ortega C4 SLBM strategic DNC OVER THE HORIZON RADAR operative
insurgent hack security mail drop radar Semtex planning Justice assassinate
( http://cscott.net/ )
Date: Fri, 30 May 2003 14:26:51 -0700
From: Neal M Gafter
To: C. Scott Ananian
Cc: jsr14-prototype-comments@sun.com
Subject: Re: Oddities in multi-dim array variance.
Just nasty little bugs.
-Neal
Date: Fri, 30 May 2003 17:31:33 -0400 (EDT)
From: C. Scott Ananian
To: Neal M Gafter
Cc: jsr14-prototype-comments@sun.com
Subject: Re: Oddities in multi-dim array variance.
On Fri, 30 May 2003, Neal M Gafter wrote:
> Just nasty little bugs.
OK. Just so I can get my signature-parser correct, though, can you
confirm that
[=[+Ljava/lang/Number;
is the correct signature for
Number[=][+] na;
(and, for that matter, for the type of
new Number[10][+]
)?
Thanks.
--scott
Nazi Seattle supercomputer assassination SSBN 743 non-violent protest
United Nations CIA AK-47 SEAL Team 6 Serbian Sabana Seca $400 million in gold bullion
( http://cscott.net/ )
Date: Fri, 30 May 2003 14:34:58 -0700
From: Neal M Gafter
To: C. Scott Ananian
Cc: jsr14-prototype-comments@sun.com
Subject: Re: Oddities in multi-dim array variance.
Yes, that's right.
-Neal