[gendarme] Re: AvoidUnusedPrivateFieldsRule - 2 bugs steves Sat Mar 17 08:09:15 2012
It's because AvoidUnusedPrivateFieldsRule does not check accesses to private field in nested types, which actually have access to private fields of their parent type. Compiler generates a nested class that implements the coroutine and all the accesses to the private fields in your example are moved into the new generated class, which is then not taken into consideration by AvoidUnusedPrivateFieldsRule. Fix seems to be easy: just check nested types for private fields access, i did it here: https://github.com/steve-s/mono-tools/commit/8e81fd26112b4fe792822b42da8a3243360ba4d9 and will send a pull request... However, if we don't take into account compiler generated nested types, it could be a sign of a bad design if a private field is used only in nested type(s), so maybe new rule? Steves On Mar 15, 9:57 pm, Calvin Rien <[EMAIL PROTECTED]> wrote: > I'm getting the AvoidUnusedPrivateFieldsRule warning in a coroutine that is > definitely using the variable. > > Here's the chunk of code causing the > warning.https://gist.github.com/748d0593277be1ca82de > -- You received this message because you are subscribed to the Google Groups "Gendarme" group. To post to this group, send email to [EMAIL PROTECTED] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/gendarme?hl=en.
- Re: [gendarme] Re: AvoidUnusedPrivateFieldsRule - 2 bugs Calvin Rien 2012/03/15
- [gendarme] Re: AvoidUnusedPrivateFieldsRule - 2 bugs steves 2012/03/17 <=
- Re: [gendarme] Re: AvoidUnusedPrivateFieldsRule - 2 bugs David Schmitt 2012/03/19