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

Don't crash on a doc comment before a pattern variable statement. #1589

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

munificent
Copy link
Member

This is a funny corner of the analyzer AST API where a PatternVariableDeclarationStatement wraps an inner PatternVariableDeclaration. The statement class isn't itself an AnnotatedNode so doesn't get caught by the first couple of cases. But its beginToken comes from the inner PatternVariableDeclaration, which is an AnnotatedNode, so we need to recurse into that.

Fix #1586.

This is a funny corner of the analyzer AST API where a
PatternVariableDeclarationStatement wraps an inner
PatternVariableDeclaration. The statement class isn't itself an
AnnotatedNode so doesn't get caught by the first couple of cases. But
its beginToken comes from the inner PatternVariableDeclaration, which
*is* an AnnotatedNode, so we need to recurse into that.

Fix #1586.
@munificent munificent merged commit dc13a2f into main Oct 24, 2024
7 checks passed
@munificent munificent deleted the 1586-doc-comment-before-pattern-var branch October 24, 2024 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash if doc comment before pattern variable declaration
3 participants