Suggestion: Class friendships #2136
Labels
Needs Proposal
This issue needs a plan that clarifies the finer details of how it could be implemented.
Revisit
An issue worth coming back to
Suggestion
An idea for TypeScript
Are there any plans to incorporate the friend keyword in TypeScript to allow class friendships and improve class encapsulation? I know (real) mixins and abstract classes are on the roadmap for 2.0. But friend classes would be practical as well...
A friend class should have access to the
private
andprotected
members of the class in which it is declared as a friend. For example:The text was updated successfully, but these errors were encountered: