-
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
Split states for is not
patterns
#52205
Conversation
@@ -52,55 +52,47 @@ private BoundExpression BindIsPatternExpression(IsPatternExpressionSyntax node, | |||
// Note that these labels are for the convenience of the compilation of patterns, and are not necessarily emitted into the lowered code. | |||
LabelSymbol whenTrueLabel = new GeneratedLabelSymbol("isPatternSuccess"); | |||
LabelSymbol whenFalseLabel = new GeneratedLabelSymbol("isPatternFailure"); | |||
|
|||
bool negated = pattern.IsNegated(out var innerPattern); | |||
BoundDecisionDag decisionDag = DecisionDagBuilder.CreateDecisionDagForIsPattern( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is simply reverted to the state before #49369
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_IsPatternOperator.cs
Show resolved
Hide resolved
<!-- | ||
Required is true when bindings are used in the opposite branch and cannot be optimized away. | ||
--> | ||
<Field Name="Required" Type="bool"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're going to need this for or
pattern bindings when we split state for those as well.
[InlineData("!(o is (41 or 42))")] | ||
[InlineData("o is not (41 or 42)")] | ||
public void IsNot_11(string pattern) | ||
public void IsNot_11a(string pattern) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for different codegen is that for some of tests we actually use linear lowering.
@cston Can you please take a look, thanks. |
On the second thought, this isn't necessary right now and can be done as part of dotnet/csharplang#4592 later. |
Follow-up on #49369
See #49369 (comment)