Minimal test case: module strange_override_bug; interface K { void f(); } class A(int m) : K { override void f() in { } body { } } class B : A!(2) { void f() { } } /* strange_override_bug.d(8): Error: variable strange_override_bug.A!(2).A.f.this override cannot be applied to variable strange_override_bug.d(9): Error: function strange_override_bug.A!(2).A.f.__require override only applies to class member functions */ Compile with "in { }" line commented out! Compiles also if i remove "override" keyword" (and it do not warn my about anything). Was working in 2.049.
'int m' parameter in template is also important. Minimizing test case by removing it, make error disappear. Changing it to general template parameter (i.e. class A(T) : K) , also makes error disappear.
*** This issue has been marked as a duplicate of issue 5145 ***