Bug 1958 – Casting to invariant breaks CTFE

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-03-30T09:42:00Z
Last change time
2015-06-09T01:14:37Z
Keywords
rejects-valid
Assigned to
nobody
Creator
samukha

Comments

Comment #0 by samukha — 2008-03-30T09:42:56Z
---- string foo() { char[] s; s ~= "aaa"; return cast(invariant)s; } enum s = foo(); ---- Error: cannot evaluate foo() at compile time
Comment #1 by clugdbug — 2009-07-10T07:54:00Z
Fixed sometime before 2.031.