As desired, the following code fails to compile: unittest { interface Foo { int a(); } } unittest { Foo f; f.a(); } However, the following code *does* compile: unittest { interface Foo { int a(); } } unittest { interface Foo { int b(); } Foo f; f.a(); // we have the wrong Foo here } and if f.a() is changed to f.b(), it doesn't compile.
Works with current dmd (2.058 & 1.068)
Wait a sec, Reiner Pope? Did we go to the same highschool?