--- Comment #3 from Kenji Hara <> 2012-03-24 10:26:02 PDT ---
(In reply to comment #2)
> Thank you for your answers. I convert this to enhancement request then.
> I think such constant-folding is useful to remove some run-time tests and 
> speed
> up other code that uses slices.

In really special case, D allows such conversion from dynamic array type to
static array type. See following:

void foo(immutable(char)[4] s){}
void main()
    static assert(is(typeof("test") == immutable(char)[]));
    foo("test");            // immutable(char)[] to immutable(char)[4]
    foo(['t','e','s','t']); // immutable(char)[] to immutable(char)[4]

So there seems to be enough reasoning for this enhancement.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to