package methods are final? huh?

Manu via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 2 04:37:34 PDT 2016


module x.a;

class A
{
package:
  int f()
  {
    return 0;
  }
}


============================
module x.b;

import x.a;

class B : A
{
package:
  override int f()
  {
    return 0;
  }
}

> error : function x.b.B.f package method is not virtual and cannot override

Why? I have a UI system with modules for each node type. UI internal
stuff is naturally 'package'. Virtuals are perfectly reasonable within
a package.


More information about the Digitalmars-d mailing list