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

           Summary: Can't get object out of Rebindable: get is private
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: jmdavisp...@gmx.com


--- Comment #0 from Jonathan M Davis <jmdavisp...@gmx.com> 2010-10-02 18:09:00 
PDT ---
This code

import std.typecons;

class T
{
    this() immutable
    {
    }
}

void main()
{
    immutable orig = new T();
    auto bound = rebindable(orig);
    immutable backOut = bound.get;
}


results in this compilation error:

d.d(14): Error: struct std.typecons.Rebindable!(immutable(T)).Rebindable member
original is not accessible
d.d(14): Error: struct std.typecons.Rebindable!(immutable(T)).Rebindable member
original is not accessible


As far as I can determine, get is the intended way to get the object out
Rebindable!() (I certainly can't see any other way), but it doesn't work. And
really, I see no point to get if it won't get you the object bound by
Rebindable!().

I think that get needs to be a property which returns original rather than just
an alias. The alias isn't working, and it makes really hard to use
Rebindable!() when you don't want to be passing Rebindable!() around
everywhere.

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

Reply via email to