MCPcopy Index your code
hub / github.com/nodejs/node / getContextualTypeForElementExpression

Function getContextualTypeForElementExpression

test/fixtures/snapshot/typescript.js:72827–72831  ·  view source on GitHub ↗
(arrayContextualType, index)

Source from the content-addressed store, hash-verified

72825 // it is the type of the numeric index signature in T. Otherwise, in ES6 and higher, the contextual type is the iterated
72826 // type of T.
72827 function getContextualTypeForElementExpression(arrayContextualType, index) {
72828 return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index)
72829 || mapType(arrayContextualType, function (t) { return getIteratedTypeOrElementType(1 /* IterationUse.Element */, t, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false); },
72830 /*noReductions*/ true));
72831 }
72832 // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type.
72833 function getContextualTypeForConditionalOperand(node, contextFlags) {
72834 var conditional = node.parent;

Callers 3

getContextualTypeFunction · 0.85
checkArrayLiteralFunction · 0.85

Calls 3

mapTypeFunction · 0.85

Tested by

no test coverage detected