do not report 'unreachable code' on empty statements

This commit is contained in:
Vladimir Matveev
2015-11-03 22:30:27 -08:00
parent 2c644476fb
commit 652a3a4a55
6 changed files with 29 additions and 39 deletions

View File

@@ -1453,8 +1453,8 @@ namespace ts {
switch (currentReachabilityState) {
case Reachability.Unreachable:
const reportError =
// report error on all statements
isStatement(node) ||
// report error on all statements except empty ones
(isStatement(node) && node.kind !== SyntaxKind.EmptyStatement) ||
// report error on class declarations
node.kind === SyntaxKind.ClassDeclaration ||
// report error on instantiated modules or const-enums only modules if preserveConstEnums is set