code: private boolean validMapunionExpression(Node expr) {
      // The expression must have four children:
      // - The mapunion keyword
      // - A union type expression
      // - A map function
      if (!checkParameterCount(expr, Keywords.MAPUNION)) {
        return false;
      }
      // The second child must be a valid union type expression
      if (!validTypeTransformationExpression(getCallArgument(expr, 0))) {
        warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 0));
        return false;
      }
      // The third child must be a function
      if (!getCallArgument(expr, 1).isFunction()) {
        warnInvalid("map function", getCallArgument(expr, 1));
        warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 1));
        return false;
      }
      Node mapFn = getCallArgument(expr, 1);
      // The map function must have only one parameter
      int mapFnParamCount = getFunctionParamCount(mapFn);
      if (mapFnParamCount < 1) {
        warnMissingParam("map function", mapFn);
        warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 1));
        return false;
      }
      if (mapFnParamCount > 1) {
        warnExtraParam("map function", mapFn);
        warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 1));
        return false;
      }
      // The body must be a valid type transformation expression
      Node mapFnBody = getFunctionBody(mapFn);
      if (!validTypeTransformationExpression(mapFnBody)) {
        warnInvalidInside("map function body", mapFnBody);
        return false;
      }
      return true;
    }
docs: A mapunion type transformation expression must be of the form
  mapunion(TTLExp, (typevar) => TTLExp).