Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid unnecessary double visits on equals containing conditional access in nullable #53569

Open
RikkiGibson opened this issue May 20, 2021 · 0 comments
Assignees
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

Comments

@RikkiGibson
Copy link
Contributor

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.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels May 20, 2021
@RikkiGibson RikkiGibson added Concept-Design Debt Engineering Debt, Design Debt, or poor product code quality New Language Feature - Nullable Reference Types Nullable Reference Types labels May 20, 2021
@jaredpar jaredpar added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 13, 2021
@jaredpar jaredpar added this to the Compiler.Next milestone Jul 13, 2021
@jaredpar jaredpar modified the milestones: Compiler.Next, Backlog Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants