Making internal & private classes sealed to avoid virtual dispatch, plus some Dictionary capacity tweaks#3552
Conversation
…lus Dictionary capacity tweaks
There was a problem hiding this comment.
Gates Passed
4 Quality Gates Passed
See analysis details in CodeScene
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
|
A MSSQL unit test is failing, can it be a timing issue? |
|
Hi @Henr1k80. It is a good point. I guess there is no real muscle memory for us around making something sealed. Probably in case we feel the need to extend it later. |
But expect a little bit of instability as we push toward our next RC. |
We should probably do this, as I think we will unlikely remember without a prompt for a while. Do you want to do that? |
…ch, plus Dictionary capacity tweaks (BrighterCommand#3552)
As the good Stephen Toub explains, there is good reasons to make classes sealed.
I can also make it a warning, if all new code does not obey this, by enabling CA1852
Then I would also have to mark all tests & examples sealed, no problem with me, but a LOT of diff lines.
Alternatively make a config for tests that explicitly ignore the rule.