http://d.puremagic.com/issues/show_bug.cgi?id=10950
--- Comment #4 from monarchdo...@gmail.com 2013-09-03 06:18:53 PDT --- (In reply to comment #2) > I think the "root" issue is that when the enum is first instantiated, the > compiler doesn't care what the "marked" type of the enum is, but rather, what > the actual (ctfe) memory points to. > > //---- > module test; > > char[] cc() > { > return cast(char[])"hello"; > } > > string ss() > { > return cast(string)['a', 'b']; > } > > void main() > { > auto cc1 = cc; //*Should* duplicate > auto cc2 = cc; //*Should* duplicate > auto ss1 = ss; //Should *not* duplicate > auto ss2 = ss; //Should *not* duplicate > assert(cc1 !is cc2); //Failed to duplicate > assert(ss1 is ss2); //Failed to not duplicate > } > //---- Sorry, the example should have been: enum cc = cast(char[])"hello"; enum ss = cast(string)['a', 'b']; void main() { auto cc1 = cc; //*Should* duplicate auto cc2 = cc; //*Should* duplicate auto ss1 = ss; //Should *not* duplicate auto ss2 = ss; //Should *not* duplicate assert(cc1 !is cc2); //Failed to duplicate assert(ss1 is ss2); //Failed to not duplicate } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------