File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -43942,7 +43942,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4394243942 }
4394343943
4394443944 function checkBlock(node: Block) {
43945- // Grammar checking for SyntaxKind.Block
43945+ if (node.statements.length === 1 && node.statements[0].kind === SyntaxKind.ExpressionStatement) {
43946+ if (isSideEffectFree((node.statements[0] as ExpressionStatement).expression)) {
43947+ error(node, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
43948+ }
43949+ }
4394643950 if (node.kind === SyntaxKind.Block) {
4394743951 checkGrammarStatementInAmbientContext(node);
4394843952 }
@@ -44491,10 +44495,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4449144495 // Grammar checking
4449244496 checkGrammarStatementInAmbientContext(node);
4449344497
44494- if (isSideEffectFree(node.expression)) {
44495- error(node, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
44496- }
44497-
4449844498 checkExpression(node.expression);
4449944499 }
4450044500
You can’t perform that action at this time.
0 commit comments