[Issue 10506] Purity should not be checked in a mixin statement

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 30 03:04:05 PDT 2013


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


Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
          Component|DMD                         |Phobos
         Resolution|                            |FIXED


--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2013-06-30 03:04:01 PDT ---
Currently (from 2.063) compiler disables purity check in CTFE context.

void foobar() pure {}

string gen()    // impure
{ return "foobar;"; }

void test() pure
{
     mixin(gen());   // succeed to compile
}

That was the std.array.join issue. It uses std.array.Appender, but Appender had
impure operation until very recent days.

https://github.com/D-Programming-Language/phobos/commit/4da1639c98cb73d07858b17c2d225063889e4700#L0L2287

(static member function "Appender.newCapacity" was impure)

Right now Appender operation is potentially pure, and in the OP case has been
also changed to pure.

-- 
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