September 13, 2004 package attribute is broken when overriding | ||||
---|---|---|---|---|
| ||||
class Foo { package void hi() { printf("Foo.hi()\n"); } } class Bar: Foo { void hi() { printf("Bar.hi()\n"); } // Line 7. } int main() { Foo b = new Bar; b.hi(); return 0; } Compiles on DMD 0.101 but prints: Foo.hi() Add "override" and the compiler prints: test.d(7): function hi function hi does not override any |
Copyright © 1999-2021 by the D Language Foundation