www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24643] New: Allow overriding of private/package class methods

https://issues.dlang.org/show_bug.cgi?id=24643

          Issue ID: 24643
           Summary: Allow overriding of private/package class methods
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: qs.il.paperinik gmail.com

"Symbols with private visibility can only be accessed from within the same
module. Private member functions are implicitly final and cannot be
overridden."

This makes no sense as a derived class in the same module can "see" the method.

Also, the spec says nowhere that `package` visibility functions aren’t virtual
or abstract, but one get the error message: "function `A.f` `package` functions
cannot be `abstract`" And they cannot be overridden.

--
Jul 01