www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6679] New: parameter with default value allows to override final interface method

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

           Summary: parameter with default value allows to override final
                    interface method
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: mrmocool gmx.de



(based on a TDPL example)

import std.stdio;

interface I
{
    final void foo() {writeln(-1);}
}

class F : I
{
    void foo(int i = 0)
    {
        writeln(i);
    }
}

void main()
{
    F f = new F;
    f.foo(); // prints 0
}

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