Created
January 27, 2019 16:44
-
-
Save controlflow/fb98f117178a53c6a0732da6de24abd4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (myConditionalExpression.ThenResult is IRefExpression thenRefExpression && thenRefExpression.Expression != null) | |
{ | |
thenRefExpression.ReplaceBy(thenRefExpression.Expression); | |
} | |
else if (myConditionalExpression.ElseResult is IRefExpression elseRefExpression && elseRefExpression.Expression != null) | |
{ | |
elseRefExpression.ReplaceBy(elseRefExpression.Expression); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (myConditionalExpression.ThenResult is IRefExpression { Expression: { } thenOperand } thenRefExpression) | |
{ | |
thenRefExpression.ReplaceBy(thenOperand); | |
} | |
else if (myConditionalExpression.ElseResult is IRefExpression { Expression: { } elseOperand } elseRefExpression) | |
{ | |
elseRefExpression.ReplaceBy(elseOperand); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment