www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 507] New: Error: 'this' is required, but ... is not a base class of ...

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=507

           Summary: Error: 'this' is required, but ... is not a base class
                    of ...
           Product: D
           Version: 0.173
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: benoit tionex.de


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


-- 
Nov 15 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=507







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.


-- 
Nov 25 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=507


deewiant gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed in DMD 0.176.


-- 
Dec 03 2006