Summary: pure nothrow Rebindable
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: enhancement
          Priority: P2
         Component: Phobos

--- Comment #0 from 2010-11-21 16:39:57 PST ---
This program looks correct:

import std.typecons: Rebindable;
const class Foo {}
pure nothrow void bar() {
    Rebindable!Foo f = new Foo;
void main() {}

But DMD 2.050 shows the errors:

test.d(4): Error: pure function 'bar' cannot call impure function 'this'
test.d(3): Error: function 'bar' is nothrow yet may throw

(I don't know if this is possible in all cases, like when Rebindable is used on
a struct with a nonpure postblit. But with class references I think this is

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to