[Issue 5145] New: override error with forward ref of superclass

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 31 12:47:32 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=5145

           Summary: override error with forward ref of superclass
           Product: D
           Version: D1
          Platform: x86
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: fawzi at gmx.ch


--- Comment #0 from Fawzi Mohamed <fawzi at gmx.ch> 2010-10-31 12:46:39 PDT ---
The following code fails with
{{{
t.d(24): Error: variable t.B.sync.this override cannot be applied to variable
t.d(25): Error: function t.B.sync.__require override only applies to class
member functions
}}}
then class B is declared after class A 
{{{
module t;

interface I1{
    void bla();
}

interface I2
{
    I1 sync ();
}

class A : B
{
    final override I1 sync()
    in { assert( valid ); }
    body
    {
        return null;
    }
}

class B : I2
{
    override I1 sync()
    in { assert( valid ); }
    body
    {
        return null;
    }

    final bool valid()
    {
        return true;
    }
}
}}}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list