[Issue 1216] New: Concatenation gives 'non-constant expression' outside CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 6 01:50:19 PDT 2007


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

           Summary: Concatenation gives 'non-constant expression' outside
                    CTFE
           Product: D
           Version: 1.014
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: reiner.pope at gmail.com


The following code:

const ulong[] A = [1UL];
const ulong[] B = A ~ [1UL];

gives:
concat.d(2): Error: non-constant expression A ~ [1LU]

But changing it to the following works:

const ulong[] A = [1UL];
const ulong[] B = getConcat(A, [1UL]);

ulong[] getConcat(ulong[] a, ulong[] b)
{
    return a ~ b;
}


-- 



More information about the Digitalmars-d-bugs mailing list