Why does C# disallow readonly local variables?

后端 未结 13 1186
萌比男神i
萌比男神i 2020-11-27 17:17

Having a friendly debate with a co-worker about this. We have some thoughts about this, but wondering what the SO crowd thinks about this?

13条回答
  •  粉色の甜心
    2020-11-27 18:00

    I think that's because a function that has a readonly variable may never be called, and there's probably something about it going out of scope, and when would you need to?

提交回复
热议问题