[Issue 2007] New: Appending one element array doesn't compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 18 09:45:29 PDT 2008


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

           Summary: Appending one element array doesn't compile
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: bartosz at relisoft.com


I'm working with arrays of arrays of strings, result and ys. I want to
append/prepend a one-element array of strings, [y], to ys. Neither compiles.

string y = "a";
string [][] ys = [];
string [][] result = [];
result = ys ~ [y];
result = [y] ~ ys;

test.d(30): Error: incompatible types for ((ys) ~ ([y])):
'invariant(char)[][][]
' and 'invariant(char)[][1u]'
test.d(31): Error: incompatible types for (([y]) ~ (ys)):
'invariant(char)[][1u]
' and 'invariant(char)[][][]'
test.d(31): Error: cannot implicitly convert expression ([y] ~ ys) of type
invar
iant(char)[][] to invariant(char)[][][]


-- 



More information about the Digitalmars-d-bugs mailing list