[Issue 19192] DMD generates invalid code for covariants involving template classes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 27 22:41:15 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19192

ag0aep6g <ag0aep6g at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
                 CC|                            |ag0aep6g at gmail.com

--- Comment #1 from ag0aep6g <ag0aep6g at gmail.com> ---
Reduced:

----
interface Foo
{
    Foo troll();
}

abstract class Barbee : Foo {}

class Bar : Barbee
{
    Bar troll() { return this; }
}

void main()
{
    Foo foo = new Bar;
    assert(foo is foo.troll); /* Fails. Should pass. */
}
----

--


More information about the Digitalmars-d-bugs mailing list