digitalmars.D.learn - Purity and enum
- simendsjo (14/14) Feb 06 2012 Not sure if this is a bug, or just some missing functionality of pure.
- Daniel Murphy (5/6) Feb 06 2012 I don't think so.
- simendsjo (2/8) Feb 06 2012 Thanks. Fixed in 2.059 perhaps? A long wait :)
- Daniel Murphy (3/15) Feb 06 2012 I wouldn't hold my breath.
Not sure if this is a bug, or just some missing functionality of pure. void f() pure { enum a = to!string("a"); // some legal compile-time to!() } Gives "to is not pure" The following works: template S(alias v) { enum S = to!string(v); } void g() pure { enum a = S!"a"; } Should purity be checked at all if used with an enum? Tested on dmd 2.057 / linux x64
Feb 06 2012
"simendsjo" <simendsjo gmail.com> wrote in message news:jgo9if$1mg9$1 digitalmars.com...Should purity be checked at all if used with an enum?I don't think so. http://d.puremagic.com/issues/show_bug.cgi?id=6169 https://github.com/D-Programming-Language/dmd/pull/652
Feb 06 2012
On 02/06/2012 11:46 AM, Daniel Murphy wrote:"simendsjo"<simendsjo gmail.com> wrote in message news:jgo9if$1mg9$1 digitalmars.com...Thanks. Fixed in 2.059 perhaps? A long wait :)Should purity be checked at all if used with an enum?I don't think so. http://d.puremagic.com/issues/show_bug.cgi?id=6169 https://github.com/D-Programming-Language/dmd/pull/652
Feb 06 2012
I wouldn't hold my breath. "simendsjo" <simendsjo gmail.com> wrote in message news:jgoejk$23j1$1 digitalmars.com...On 02/06/2012 11:46 AM, Daniel Murphy wrote:"simendsjo"<simendsjo gmail.com> wrote in message news:jgo9if$1mg9$1 digitalmars.com...Thanks. Fixed in 2.059 perhaps? A long wait :)Should purity be checked at all if used with an enum?I don't think so. http://d.puremagic.com/issues/show_bug.cgi?id=6169 https://github.com/D-Programming-Language/dmd/pull/652
Feb 06 2012