casting array literals doesn't work as stated in the docs

bearophile bearophileHUGS at lycos.com
Sun Jan 3 01:21:08 PST 2010


Denis Koroskin:
> "Proper" code should look like this:
> short[] t = [cast(short) 5, cast(short)3];
> which is err... I'll let someone else to decide. Just imagine there are  
> ten (or more) values in an array literal.

What's wrong with just (D2 code):
short[] a3 = [5, 3];

Bye,
bearophile



More information about the Digitalmars-d mailing list