diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 48ee8a4c89996..82a32e47578b1 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -5608,7 +5608,13 @@ namespace ts { ); } } - return finishNode(factory.createBlock(statements, multiLine), pos); + const result = withJSDoc(finishNode(factory.createBlock(statements, multiLine), pos), hasJSDoc); + if (token() === SyntaxKind.EqualsToken) { + parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses); + nextToken(); + } + + return result; } else { const statements = createMissingList();