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

FindNode can't find OmittedArraySizeExpressionSyntax #47706

Open
svick opened this issue Sep 15, 2020 · 0 comments
Open

FindNode can't find OmittedArraySizeExpressionSyntax #47706

svick opened this issue Sep 15, 2020 · 0 comments

Comments

@svick
Copy link
Contributor

svick commented Sep 15, 2020

Version Used: 3.7.0

Steps to Reproduce:

Run the following code:

var type = SyntaxFactory.ParseTypeName("int[]");

var omittedExpression = type.DescendantNodes().OfType<OmittedArraySizeExpressionSyntax>().Single();

Console.WriteLine(type.FindNode(omittedExpression.FullSpan, getInnermostNodeForTie: true).Kind());

Expected Behavior: The code prints OmittedArraySizeExpression.

Actual Behavior: The code prints ArrayRankSpecifier.

Presumably, the issue is that the width of the OmittedArraySizeExpression node is zero, i.e. its FullSpan is [4..4).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants