@@ -17757,15 +17757,14 @@ namespace ts {
1775717757 return getBestChoiceType(type1, type2);
1775817758 }
1775917759
17760- function checkLiteralExpression(node: Expression): Type {
17761- if (node.kind === SyntaxKind.NumericLiteral) {
17762- checkGrammarNumericLiteral(<NumericLiteral>node);
17763- }
17760+ function checkLiteralExpression(node: LiteralExpression | Token<SyntaxKind.TrueKeyword | SyntaxKind.FalseKeyword>): Type {
1776417761 switch (node.kind) {
17762+ case SyntaxKind.NoSubstitutionTemplateLiteral:
1776517763 case SyntaxKind.StringLiteral:
17766- return getFreshTypeOfLiteralType(getLiteralType((<LiteralExpression> node) .text));
17764+ return getFreshTypeOfLiteralType(getLiteralType(node.text));
1776717765 case SyntaxKind.NumericLiteral:
17768- return getFreshTypeOfLiteralType(getLiteralType(+(<LiteralExpression>node).text));
17766+ checkGrammarNumericLiteral(<NumericLiteral>node);
17767+ return getFreshTypeOfLiteralType(getLiteralType(+node.text));
1776917768 case SyntaxKind.TrueKeyword:
1777017769 return trueType;
1777117770 case SyntaxKind.FalseKeyword:
@@ -17983,15 +17982,14 @@ namespace ts {
1798317982 return checkSuperExpression(node);
1798417983 case SyntaxKind.NullKeyword:
1798517984 return nullWideningType;
17985+ case SyntaxKind.NoSubstitutionTemplateLiteral:
1798617986 case SyntaxKind.StringLiteral:
1798717987 case SyntaxKind.NumericLiteral:
1798817988 case SyntaxKind.TrueKeyword:
1798917989 case SyntaxKind.FalseKeyword:
17990- return checkLiteralExpression(node);
17990+ return checkLiteralExpression(node as LiteralExpression );
1799117991 case SyntaxKind.TemplateExpression:
1799217992 return checkTemplateExpression(<TemplateExpression>node);
17993- case SyntaxKind.NoSubstitutionTemplateLiteral:
17994- return stringType;
1799517993 case SyntaxKind.RegularExpressionLiteral:
1799617994 return globalRegExpType;
1799717995 case SyntaxKind.ArrayLiteralExpression:
0 commit comments