(callTarget, arg)
| 72577 | } |
| 72578 | // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter. |
| 72579 | function getContextualTypeForArgument(callTarget, arg) { |
| 72580 | var args = getEffectiveCallArguments(callTarget); |
| 72581 | var argIndex = args.indexOf(arg); // -1 for e.g. the expression of a CallExpression, or the tag of a TaggedTemplateExpression |
| 72582 | return argIndex === -1 ? undefined : getContextualTypeForArgumentAtIndex(callTarget, argIndex); |
| 72583 | } |
| 72584 | function getContextualTypeForArgumentAtIndex(callTarget, argIndex) { |
| 72585 | if (ts.isImportCall(callTarget)) { |
| 72586 | return argIndex === 0 ? stringType : |
no test coverage detected
searching dependent graphs…