code: function getContextualTypeForArgument(callTarget, arg) {
              var args = getEffectiveCallArguments(callTarget);
              var argIndex = ts.indexOf(args, arg);
              if (argIndex >= 0) {
                  var signature = getResolvedOrAnySignature(callTarget);
                  return getTypeAtPosition(signature, argIndex);
              }
              return undefined;
          }
docs: In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter.