[Issue 10950] [CTFE] enum "char[]" not correctly duplicated when used.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 4 01:24:34 PDT 2013


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



--- Comment #5 from Don <clugdbug at yahoo.com.au> 2013-09-04 01:24:33 PDT ---
You seem to be expecting the .dup to act as a macro, and be automatically
applied to any code that uses the enum? But it doesn't work like that. The
expression is evaluated to form a value. How the value was generated is
irrelevant. CTFE expressions never behave like macros.

There were bugs in how it worked before (long ago, they were terrible, and
accidentally behaved like macros. See bug 2414).

Bug 4397 is another case very similar to this. It's not an implementation
issue. The root cause is that enums of reference types *do not make sense*.
It's an accident that they were ever accepted, and is related to bug 2414.

None of your test cases should compile.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list