Bug 1216 – Concatenation gives 'non-constant expression' outside CTFE

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2007-05-06T03:50:00Z
Last change time
2014-02-16T15:25:54Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
reiner.pope

Comments

Comment #0 by reiner.pope — 2007-05-06T03:50:18Z
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; }
Comment #1 by smjg — 2007-05-06T18:44:59Z
Could be related to issue 963....
Comment #2 by bugzilla — 2007-07-01T14:01:26Z
Fixed DMD 1.018 and DMD 2.002