Created
March 9, 2016 18:56
-
-
Save jcouv/d20e55eb4804b791c7d4 to your computer and use it in GitHub Desktop.
Repro for #8625
This file contains 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
public void SyntaxNodeContains() | |
{ | |
var text = "a + (b - (c * (d / e)))"; | |
var expression = SyntaxFactory.ParseExpression(text); | |
var a = expression.DescendantNodes().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "a"); | |
var e = expression.DescendantNodes().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "e"); | |
var firstParens = e.FirstAncestorOrSelf<ExpressionSyntax>(n => n.Kind() == SyntaxKind.ParenthesizedExpression); | |
Assert.False(firstParens.Contains(a)); // fixing #8625 allows this to return quicker | |
Assert.True(firstParens.Contains(e)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment