[Issue 11091] New: Deduced purity doesn't work?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 22 02:49:36 PDT 2013


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

           Summary: Deduced purity doesn't work?
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: simendsjo at gmail.com


--- Comment #0 from simendsjo <simendsjo at gmail.com> 2013-09-22 02:49:35 PDT ---
Tried running dmd+phobos head at some code, but got errors.

This is probably the breaking change:
https://github.com/D-Programming-Language/phobos/commit/7714a9c42e2cc8d794a5ee483fdd49d52995b3ac


import std.exception;

class E: Exception
{
    this(string msg, string file=__FILE__, size_t line=__LINE__) { super(msg,
file, line); }
}

void f() pure
{
    enforceEx!E(true);
}
void main() {
    f();
}

// Error: pure function 't.f' cannot call impure function
'std.exception.enforceEx!(E).enforceEx!bool.enforceEx

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