开发者

Is there a way to make the C# compiler issue a warning when instance variable is hidden(shadowed)?

I am refactoring a little bit of code and I think I have created so开发者_JAVA技巧me instance variables that are being hidden(shadowed) in older methods. I want to see a warning wherever the hiding(shadowing) happens so I can check to make sure that it's actually what I want (and it's hardly ever what I want). Is there any easy way to do that?


If you run Code Analysis, that'll show up (as CA1500 from the Maintanability section).


Have you looked into any productivity tools such as Resharper? http://www.jetbrains.com/resharper/

It will find that (and probably proactively warn you) with very little effort on your part.


No there is no way to make the C# compiler emit this warning.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜