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

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1216 - Concatenation gives 'non-constant expression' outside CTFE
Summary: Concatenation gives 'non-constant expression' outside CTFE
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Linux
: P2 normal
Assignee: Walter Bright
URL:
Keywords: rejects-valid
Depends on:
Blocks:
Reported: 2007年05月06日 03:50 UTC by Reiner Pope
Modified: 2014年02月16日 15:25 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Reiner Pope 2007年05月06日 03:50:18 UTC
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 Stewart Gordon 2007年05月06日 18:44:59 UTC
Could be related to issue 963....
Comment 2 Walter Bright 2007年07月01日 14:01:26 UTC
Fixed DMD 1.018 and DMD 2.002


AltStyle によって変換されたページ (->オリジナル) /