-
-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6383 from MartinNowak/fix16980
fix Issue 16980 - wrong interface called
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// https://issues.dlang.org/show_bug.cgi?id=16980 | ||
interface A { void foo(); } | ||
interface B { void bar(); } | ||
interface AB : A, B {} | ||
class C : AB { | ||
void foo() { assert(false, "Must never be called!"); } | ||
void bar() {} | ||
} | ||
|
||
struct T() { | ||
AB ab; | ||
~this() { | ||
ab.bar(); // uses wrong vtable | ||
} | ||
} | ||
|
||
T!() tinst; // triggers semantic3 of dtor from Module::semantic(1) | ||
|
||
void main() | ||
{ | ||
auto dst = T!()(new C); | ||
} |