Avoid unnecessary double visits on equals containing conditional access in nullable #53569
Labels
Area-Compilers
Bug
Concept-Design Debt
Engineering Debt, Design Debt, or poor product code quality
New Language Feature - Nullable Reference Types
Nullable Reference Types
Milestone
I seems that when this condition is false, we'll have done the first visit (based on when-not-null state) for nothing.
I suspect we can re-organize the code to do the second visit (based on worst-case state) first, then decide if we need to do the first visit (based on when-not-null state). #Closed
Originally posted by @jcouv in #53198 (comment)
It seems like we might be able to refactor the implementation to do the "worst case" visit for diagnostics/public API first, then only if the right side is "known null or not null", would we actually do the second visit to update the "state when not null".
However, I am concerned about brittleness and potentially strange correctness issues when we don't do the "worst case" visit last, so I'd like to punt on this optimization for now.
The text was updated successfully, but these errors were encountered: