-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Do not offer to convert switches when ref-returns are involved. #40236
Conversation
...SwitchStatementToExpression/ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs
Outdated
Show resolved
Hide resolved
...res/CSharpTest/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionTests.cs
Outdated
Show resolved
Hide resolved
Actually though, using 'ref' inside the conditional is fine if you're not using the outer-ref. Will update. |
We probably need to update IfToSwitch to handle ref returns in switch expressions. |
I'll see if i can find that! if not, maybe you can contribute to this PR? Thanks! |
Actually, i think i may not have time for this. If you want to add to this PR that would be fine! |
...SwitchStatementToExpression/ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs
Show resolved
Hide resolved
@mavasani LMK what you need here to proceed. |
Thanks! |
Fixes #40198