[Issue 6408] string[].init gives a wrong type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jul 30 09:13:41 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6408



--- Comment #2 from bearophile_hugs at eml.cc 2011-07-30 09:13:40 PDT ---
(In reply to comment #1)
> Apparently DMD shouldn't accept string[].init at all, e.g. int[].init is a
> parser error:

Isn't it better to modify DMD to accept both string[].init and int[].init, and
return the correct results in both cases?

Because the alternative idiom to create an empty array is to use cast(int[])[],
and it's better to avoid casts where possible.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list