www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5252] New: pure nothrow Rebindable

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5252

           Summary: pure nothrow Rebindable
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 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 test3.bar '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
possible).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 21 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5252



--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2011-09-09 07:59:31 PDT ---
Maybe this issue was fixed by pure nothrow inference feature.

In 2.055, that code can compile.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 09 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5252


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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