docs: function getElementTypeOfIterable(type, errorNode) {
              if (isTypeAny(type)) {
                  return undefined;
              }
              var typeAsIterable = type;
              if (!typeAsIterable.iterableElementType) {
                  // As an optimization, if the type is instantiated directly using the globalIterableType (Iterable<number>),
                  // then just grab its type argument.
                  if ((type.flags & 131072 /* Reference */) && type.target === getGlobalIterableType()) {
                      typeAsIterable.iterableElementType = type.typeArguments[0];
                  }
                  else {
                      var iteratorFunction = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator"));
                      if (isTypeAny(iteratorFunction)) {
                          return undefined;
                      }
                      var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0 /* Call */) : emptyArray;
                      if (iteratorFunctionSignatures.length === 0) {
                          if (errorNode) {
                              error(errorNode, ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator);
                          }
                          return undefined;
                      }
                      typeAsIterable.iterableElementType = getElementTypeOfIterator(getUnionType(ts.map(iteratorFunctionSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true), errorNode);
                  }
              }
              return typeAsIterable.iterableElementType;
          }