What is the meaning of the planned “private protected” C# access modifier?

前端 未结 6 1405
名媛妹妹
名媛妹妹 2020-12-02 05:49

As part of the Roslyn documentation on GitHub, there\'s a page called Language feature implementation status, with planned language features for C# and VB.

One featu

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-02 06:32

    This is just to provide a graph (made with http://ashitani.jp/gv/) of the different accessibility levels (images do not fit in comments).

    digraph diagram of C# access levels

    Each arrow means "is more restrictive than".

    The CLR names are Private, FamilyANDAssembly, Assembly, Family, FamilyORAssembly, Public.


    Much later edit: It turned out this nice new access level (with a really poor name) was not eventually included in C# 6.0. It is supported only from C# 7.2 (and I see you updated your question "tags").

提交回复
热议问题