(node)
| 79801 | return type; |
| 79802 | } |
| 79803 | function getQuickTypeOfExpression(node) { |
| 79804 | var expr = ts.skipParentheses(node, /*excludeJSDocTypeAssertions*/ true); |
| 79805 | if (ts.isJSDocTypeAssertion(expr)) { |
| 79806 | var type = ts.getJSDocTypeAssertionType(expr); |
| 79807 | if (!ts.isConstTypeReference(type)) { |
| 79808 | return getTypeFromTypeNode(type); |
| 79809 | } |
| 79810 | } |
| 79811 | expr = ts.skipParentheses(node); |
| 79812 | // Optimize for the common case of a call to a function with a single non-generic call |
| 79813 | // signature where we can just fetch the return type without checking the arguments. |
| 79814 | if (ts.isCallExpression(expr) && expr.expression.kind !== 106 /* SyntaxKind.SuperKeyword */ && !ts.isRequireCall(expr, /*checkArgumentIsStringLiteralLike*/ true) && !isSymbolOrSymbolForCall(expr)) { |
| 79815 | var type = ts.isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : |
| 79816 | getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression)); |
| 79817 | if (type) { |
| 79818 | return type; |
| 79819 | } |
| 79820 | } |
| 79821 | else if (ts.isAssertionExpression(expr) && !ts.isConstTypeReference(expr.type)) { |
| 79822 | return getTypeFromTypeNode(expr.type); |
| 79823 | } |
| 79824 | else if (node.kind === 8 /* SyntaxKind.NumericLiteral */ || node.kind === 10 /* SyntaxKind.StringLiteral */ || |
| 79825 | node.kind === 110 /* SyntaxKind.TrueKeyword */ || node.kind === 95 /* SyntaxKind.FalseKeyword */) { |
| 79826 | return checkExpression(node); |
| 79827 | } |
| 79828 | return undefined; |
| 79829 | } |
| 79830 | /** |
| 79831 | * Returns the type of an expression. Unlike checkExpression, this function is simply concerned |
| 79832 | * with computing the type and may not fully check all contained sub-expressions for errors. |
no test coverage detected
searching dependent graphs…