www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12508] New: Codegen bug for interface type covariant return with lambda type inference

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

           Summary: Codegen bug for interface type covariant return with
                    lambda type inference
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg gmail.com> 2014-04-02 22:11:59 PDT ---
From: http://forum.dlang.org/thread/trgoqwtuxzioeferomez forum.dlang.org

Test case:

interface A(T)
{
    T getT();
}

class C : A!double
{
    double getT() { return 1; }
}

void mwriteln(A!double delegate() dg)
{
    import core.stdc.stdio;

    auto a = dg();
    assert(a !is null);
    assert(a.getT() == 1.0);    // fails!
}

void main()
{
    mwriteln({ return new C(); });
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 02 2014
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12508


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2014-04-02 22:25:31 PDT ---
https://github.com/D-Programming-Language/dmd/pull/3417

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