diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index eaeb645204..bfa5fb6ee1 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2541,11 +2541,7 @@ namespace ts { } function parseTypeOrTypePredicate(): TypeNode { - let typePredicateVariable: Identifier; - if (isIdentifier()) { - typePredicateVariable = tryParse(parseTypePredicatePrefix); - } - + const typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); const type = parseType(); if (typePredicateVariable) { const node = createNode(SyntaxKind.TypePredicate, typePredicateVariable.pos);