[Issue 2019] New: Appending a one-element array literal doesn't work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 20 16:32:29 PDT 2008


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

           Summary: Appending a one-element array literal doesn't work
           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


The following code doesn't compile:
  string [][] result = [];
  string s = "";
  result = result ~ [s];
Error: incompatible types for ((result) ~ ([s])): 'invariant(char)[][][]' and
'invariant(char)[][1u]'
I had to use the following workaround:
  string [][] result = [];
  string [] single = [s];
  result = result ~ single;


-- 



More information about the Digitalmars-d-bugs mailing list