Bug 1217 – Dollar ($) seen as non-constant expression in non-char[] array

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

Comments

Comment #0 by reiner.pope — 2007-05-06T16:07:37Z
The following code fails to compile: const ulong[] A = ([1LU])[0..$]; with error message slice.d(1): Error: non-constant expression [1LU][0u..__dollar] However, the following similar code *does* compile: const char[] A = "a"[0..$];
Comment #1 by bugzilla — 2007-07-01T14:01:47Z
Fixed DMD 1.018 and DMD 2.002