mono/mono-tools — pull request #26 by steve-s (2012-03-17 15:12:18+00:00)
Title: AvoidUnusedPrivateFieldsRule scans nested types for private fields usage.

In the discussion [1] it was reported that AvoidUnusedPrivateFieldsRule fails when a private field is accessed only in a coroutine, this is because AvoidUnusedPrivateFieldsRule didn't check nested types, which have access to private fields.

Fix seems to be straightforward: the piece of code that inspects the checked type itself for private fields usage was refactored into a method (CheckFieldsUsageInType) and is now used to check also all the nested types of the checked type.

[1] http://groups.google.com/group/gendarme/browse_thread/thread/2625c1ed5c5e1987