www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - 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
Sep 12 2004