digitalmars.D.bugs - [Issue 15011] New: can override public method with protected method
- via Digitalmars-d-bugs (35/35) Sep 04 2015 https://issues.dlang.org/show_bug.cgi?id=15011
https://issues.dlang.org/show_bug.cgi?id=15011 Issue ID: 15011 Summary: can override public method with protected method Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: minor Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: yosikawa altalk.com following code prints 'Foo2' expected result is compile error. DMD32 D Compiler v2.068.0 file main.d: import foo; void main() { Foo1 foo = new Foo2(); foo.bar(); } file foo.d: import std.stdio; class Foo1 { void bar() { writeln("Foo1"); } }; class Foo2 : Foo1 { protected override void bar() { writeln("Foo2"); } }; --
Sep 04 2015