D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6679 - Parameter with default value allows hijacking of final interface method
Summary: Parameter with default value allows hijacking of final interface method
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2011-09-15 18:21 UTC by Trass3r
Modified: 2024-12-13 17:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Trass3r 2011-09-15 18:21:42 UTC
(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
}
Comment 1 dlangBugzillaToGithub 2024-12-13 17:56:26 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18370

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB