Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on SEF expression statements #60936

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Error on SEF expression statements
RyanCavanaugh committed Jan 8, 2025
commit 8b38313b8f31b306dde26fc0660a487886bc3f73
4 changes: 4 additions & 0 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
@@ -44491,6 +44491,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// Grammar checking
checkGrammarStatementInAmbientContext(node);

if (isSideEffectFree(node.expression)) {
error(node, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
}

checkExpression(node.expression);
}