[Issue 7296] [2.058] Regression: Cannot swap RefCounted

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 22 08:16:24 PST 2012


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


Brad Roberts <braddr at puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|2.058                       |---

Andrei Alexandrescu <andrei at metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|andrei at metalanguage.com     |bugzilla at digitalmars.com


--- Comment #1 from Andrei Alexandrescu <andrei at metalanguage.com> 2012-01-22 08:16:23 PST ---
This is a compiler issue that I reduced to this:


struct S
{
    int member;
    @property ref int refCountedPayload() { return member; }
    alias refCountedPayload this;
}

void foo(S, T, Tdummy=void)(ref const S source, ref const T target) @trusted
pure nothrow
{
}
// for shared objects
void foo(S, T)(ref const shared S source, ref const shared T target) @trusted
pure nothrow
{
    alias foo!(shared(S), shared(T), void) ptsTo;  // do instantiate explicitly
    ptsTo(source, target);
}

void bar(T)(ref T lhs, ref T rhs) @trusted pure nothrow
{
    foo(lhs, rhs);
}

void main() {
    S a, b;
    bar(a, b);
}

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