diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7220182bfe96b..67da8c96be7a5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4853,6 +4853,13 @@ module ts { narrowedType = narrowType(type, (node).condition, /*assumeTrue*/ child === (node).whenTrue); } break; + case SyntaxKind.CaseClause: + // In a case clause of a switch statement using typeof + var parent = (node).parent; + if((parent).expression.kind === SyntaxKind.TypeOfExpression){ + narrowedType = checkExpression(((node).expression).text); + } + break; case SyntaxKind.BinaryExpression: // In the right operand of an && or ||, narrow based on left operand if (child === (node).right) {