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


Lewis <lewis1...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lewis1...@gmail.com
         OS/Version|Windows                     |Linux
           Severity|normal                      |major


--- Comment #4 from Lewis <lewis1...@gmail.com> 2010-10-31 15:52:50 PDT ---
I can confirm this bug.

It especially annoying because if you copypasta the bit on pure functionns
straight out of TDPL it *will compile*, when the comment says it shouldn't.

import std.stdio;

void main()
{
    pure bool leapYear(uint y)
    {
        auto result = (y % 4) == 0 && (y % 100 || (y % 400) == 0);
        if (result) writeln(y, " is a leap year!"); // Error!
        // Cannot call impure function writeln from pure function!
        return result;
    }

    leapYear(1);
}

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

Reply via email to