Why is internal protected not more restrictive than internal?

后端 未结 8 2155
陌清茗
陌清茗 2020-12-08 04:33

I\'d like to create an internal auto-property:

internal bool IP { get; protected internal set; }

I thought it would be possible to make the

8条回答
  •  青春惊慌失措
    2020-12-08 05:13

    I would consider this cheating, since Eric Lippert is on SO himself, but he wrote an excellent blog post that considers this issue.

    Why Can't I Access A Protected Member From A Derived Class, Part Three

    Ultimately, his answer is largely the same as those given by the posters here, but he ads some interesting reasoning behind the desgin of the language and the implementation of these features.

提交回复
热议问题