dbolin / Apex.Analyzers

Roslyn powered analyzers for C# to support convention defined architecture
MIT License
15 stars 2 forks source link

Treat white-listed delegates as immutable regardless of type parameters #38

Closed mwelsh1118 closed 4 years ago

mwelsh1118 commented 4 years ago

This is the simplest way I could think of to satisfy #37. If a delegate is white-listed, it ignores the type parameters when checking for immutability. I can't think of a situation where a delegate would be explicitly white-listed but the user would want the type parameters of that delegate tested for immutability. This still maintains the behavior of treating delegates as mutable by default.

dbolin commented 4 years ago

I'm merging this as it's a really simple way to handle the problem and it's not like there aren't other types with special treatment. Although I do want a way eventually to allow immutable types to have generic type parameters that aren't used as fields skip verification.