Thread overview
[Issue 10806] Interface covariance for more than one interface at once also broken
Mar 29, 2019
FeepingCreature
Mar 29, 2019
Dlang Bot
Mar 30, 2019
Dlang Bot
June 09, 2015
https://issues.dlang.org/show_bug.cgi?id=10806

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|D1 & D2                     |D2

--
March 29, 2019
https://issues.dlang.org/show_bug.cgi?id=10806

--- Comment #4 from FeepingCreature <default_357-line@yahoo.de> ---
This problem still exists on master.

To demonstrate why it's a problem:

import std.stdio;

interface A1 { A1 foo(); }
interface A2 { A2 foo(); void bar(); }

class C1 : A1, A2 {
  override C1 foo() { return new C1; }
  override void bar() { writefln("bar"); }
}

void main() {
  A2 x = new C1;
  A2 y = x.foo();
  writefln("X: %s", x.classinfo);
  writefln("Y: %s", y.classinfo);
  y.bar();
}

Note that "A2 y" has an A1 vtable.

--
March 29, 2019
https://issues.dlang.org/show_bug.cgi?id=10806

Dlang Bot <dlang-bot@dlang.rocks> changed:

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

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
@FeepingCreature created dlang/dmd pull request #9515 "Fix issue 10806: check every interface for covariance, not just the first" fixing this issue:

- Fix issue 10806: check every interface for covariance, not just the first

https://github.com/dlang/dmd/pull/9515

--
March 30, 2019
https://issues.dlang.org/show_bug.cgi?id=10806

Dlang Bot <dlang-bot@dlang.rocks> changed:

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

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #9515 "Fix issue 10806: check every interface for covariance, not just the first" was merged into master:

- 175de6781a1b199c318b25db5494619ada84102c by Mathis Beer:
  Fix issue 10806: check every interface for covariance, not just the first

https://github.com/dlang/dmd/pull/9515

--