[Issue 7493] Initialization of void[][N]

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 21 13:09:50 PDT 2012


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


timon.gehr at gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr at gmx.ch


--- Comment #4 from timon.gehr at gmx.ch 2012-03-21 13:10:05 PDT ---
DMD is inconsistent here. It is not clear what the behavior should be.

void main(){
    string[] s1,s2;
    s1=s1~[];
    s2~=[];
    writeln(s1," ",s2); // [""] []
}

I think most reasonable would be to check the array type for implicit
conversions first and to consider the element type for implicit conversions
only after the conversion to the array has failed. This would make
appending/concatenating with an empty array literal a no-op for all array types
and it would restore the behavior the OP expects.

-- 
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