Primarily intended to eliminate the following two antipatterns:
default(T).Method()
instance.Method(ref instance)
This PR could be both overzealous (taking away the ability to vary behavior by instance) and non-exhaustive at the same time.
I addressed the above mentioned antipatterns, then skimmed over all interfaces and how they are used, trying to get a rough idea of whether making them static appears sensible. A deeper understanding of the engine might allow better judgement on some of these calls.
I've also taken the liberty of fixing a typo here and there and removing a redundant unsafe when it was next to the code I was modifying.
I understand that this PR is quite large (although it contains no functional changes!) If desired I could split it up into a part solely addressing the "safe" fixes to the antipatterns above and then see where it's going from there.
Inspired by the TODO on
IShape
.Primarily intended to eliminate the following two antipatterns:
default(T).Method()
instance.Method(ref instance)
This PR could be both overzealous (taking away the ability to vary behavior by instance) and non-exhaustive at the same time. I addressed the above mentioned antipatterns, then skimmed over all interfaces and how they are used, trying to get a rough idea of whether making them static appears sensible. A deeper understanding of the engine might allow better judgement on some of these calls.
I've also taken the liberty of fixing a typo here and there and removing a redundant
unsafe
when it was next to the code I was modifying.I understand that this PR is quite large (although it contains no functional changes!) If desired I could split it up into a part solely addressing the "safe" fixes to the antipatterns above and then see where it's going from there.
P.S.: Thank you for this awesome lib!