Bug 5253 – Regression (2.050): in contracts are not allowed in overriden methods.
Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2010-11-21T18:27:00Z
Last change time
2010-11-22T07:01:01Z
Assigned to
nobody
Creator
witold.baryluk+d
Comments
Comment #0 by witold.baryluk+d — 2010-11-21T18:27:41Z
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.
Comment #1 by witold.baryluk+d — 2010-11-21T18:50:07Z
'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.
Comment #2 by clugdbug — 2010-11-22T07:01:01Z
*** This issue has been marked as a duplicate of issue 5145 ***