VSDiagnostics
VSDiagnostics copied to clipboard
Implement MutableStruct analyzer
We already have a diagnostic that warns you when you're re-assigning this
inside a struct. Now, let's add a diagnostic that warns you whenever you try to assign a field or property in a struct outside of the constructor.
This is a good one. Easy to get wrong if you're not paying attention.
Additionally: also warn when the struct
has a class
member (field/property) that is mutable. This means we'll have to look through that class' structure and determine if it's mutable or not. This will also help #559
Additionally: warn when the struct
has public/internal fields or properties with a setter (read-only properties are excluded of course).