Bug 507 – Error: 'this' is required, but ... is not a base class of ...

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-11-15T03:52:00Z
Last change time
2014-02-15T13:20:07Z
Assigned to
bugzilla
Creator
benoit

Comments

Comment #0 by benoit — 2006-11-15T03:52:30Z
module t; class B { public void s() {} } class C : B { alias B.s s; public static void s(int i) {} public void s() {} } class C2 { public void f() { C.s(0); // line 17 } } void main() { } t.d(17): Error: 'this' is required, but t.C is not a base class of C2
Comment #1 by benoit — 2006-11-25T07:01:59Z
(In reply to comment #0) I want to add, this is not as much a problem for writing code manually. But when generating code, it is necessary if the generator does not compare the signatures for compatibility. Because of that I generate aliases for all methods that exist in a super class and are redefined in the actual class. The decision if override or overload applies is by the compiler. This bug blocks this way of code generation.
Comment #2 by matti.niemenmaa+dbugzilla — 2006-12-03T03:52:47Z
Fixed in DMD 0.176.