Skip to content

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