-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't crash on a doc comment before a pattern variable statement.
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.
- Loading branch information
1 parent
89577e7
commit 922d809
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
>>> | ||
main() { | ||
/// Doc comment. | ||
final (a, b) = c; | ||
} | ||
<<< | ||
main() { | ||
/// Doc comment. | ||
final (a, b) = c; | ||
} |