September 16, 2011 [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 --- Comment #0 from Trass3r <mrmocool@gmx.de> 2011-09-15 18:21:42 PDT --- (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: ------- |
Copyright © 1999-2021 by the D Language Foundation