If an interface makes a virtual function call in its precondition block then the call gets dispatched to the wrong vtbl entry. (Probably to toHash() in the following program). For the bug to occur, the derived class must have a precondition block as well. Also see the following discussion: http://forum.dlang.org/thread/m3bbbb$lgi$1@digitalmars. import std.stdio; interface I { void foo() in { int result = virtualCall(); writeln(result); } int virtualCall(); } class C : I { void foo() in {} body {} int virtualCall() { return 42; } } void main() { new C().foo(); } The output of the program is not the expected 42 from virtualCall(): -226009216 Ali
Tested with DMD 2.082.0. Program output was "42" as desired.
According to run.dlang.io, happened around 2.071