http://www.digitalmars.com/d/2.0/expression.html#ArrayLiteral

The code example from the docs yields [1 1] and [1 0 1 0] instead of [1 1] and [257] for dmd 2.037.


Additionally

short[] t = [cast(short) 5, 3];
short[] t2 = [cast(short) 5, 3].dup;

void main()
{ ...

yields:

Error: cannot evaluate _adDupT((& D12TypeInfo_G2i6__initZ),[5,3]) at compile-time Error: cannot implicitly convert expression (_adDupT((& D12TypeInfo_G2i6__initZ),[5,3])) of type int[] to short[] Error: cannot evaluate _adDupT((& D12TypeInfo_G2i6__initZ),[5,3]) at compile-time


Using int instead of short only removes the second message.


Compiler bug(s)?

Reply via email to