[Issue 24643] New: Allow overriding of private/package class methods

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 1 17:04:56 UTC 2024


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 at puremagic.com
          Reporter: qs.il.paperinik at 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.

--


More information about the Digitalmars-d-bugs mailing list