[Issue 4679] New: Problem with final & override
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Aug 19 06:22:43 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4679
Summary: Problem with final & override
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-08-19 06:22:41 PDT ---
This D2 program compiles and runs with DMD 2.048 with no errors:
import std.c.stdio: puts;
class Base {
this() { foo(); }
private void foo() { puts("Base.foo"); } // called
}
class Derived : Base {
private override void foo() { // not called
puts("Derived.foo");
super.foo();
}
}
void main() {
auto d = new Derived();
}
Output:
Base.foo
If Base.foo() is private then it's final. Then what is Derived.foo()
overriding?
--
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