Skip to content

Commit add7c1a

Browse files
committed
Flip check, add SEF cases
1 parent ced5f62 commit add7c1a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13257,13 +13257,16 @@ namespace ts {
1325713257
case SyntaxKind.Identifier:
1325813258
case SyntaxKind.StringLiteral:
1325913259
case SyntaxKind.RegularExpressionLiteral:
13260+
case SyntaxKind.TaggedTemplateExpression:
13261+
case SyntaxKind.TemplateExpression:
1326013262
case SyntaxKind.NoSubstitutionTemplateLiteral:
1326113263
case SyntaxKind.NumericLiteral:
1326213264
case SyntaxKind.TrueKeyword:
1326313265
case SyntaxKind.FalseKeyword:
1326413266
case SyntaxKind.NullKeyword:
1326513267
case SyntaxKind.UndefinedKeyword:
1326613268
case SyntaxKind.FunctionExpression:
13269+
case SyntaxKind.ClassExpression:
1326713270
case SyntaxKind.ArrowFunction:
1326813271
case SyntaxKind.ArrayLiteralExpression:
1326913272
case SyntaxKind.ObjectLiteralExpression:
@@ -13465,7 +13468,7 @@ namespace ts {
1346513468
checkAssignmentOperator(rightType);
1346613469
return getRegularTypeOfObjectLiteral(rightType);
1346713470
case SyntaxKind.CommaToken:
13468-
if (isSideEffectFree(left) && !compilerOptions.allowUnreachableCode) {
13471+
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) {
1346913472
error(left, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
1347013473
}
1347113474
return rightType;

0 commit comments

Comments
 (0)