third_party/closure-compiler/src/src/com/google/javascript/rhino/jstype/UnionType.java
/**
   * Two union types are equal if, after flattening nested union types, they have the same number of
   * alternates and all alternates are equal.
   */
Two union types are equal if, after flattening nested union types, they have the same number of
alternates and all alternates are equal.
Two union types are equal if after flattening nested union types they have the same number of alternates and all alternates are equal .
boolean checkUnionEquivalenceHelper(UnionType that, EquivalenceMethod eqMethod, EqCache eqCache) {
    List<JSType> thatAlternates = that.getAlternates();
    if (eqMethod == EquivalenceMethod.IDENTITY && alternates.size() != thatAlternates.size()) {
      return false;
    }
    for (int i = 0; i < thatAlternates.size(); i++) {
      JSType thatAlternate = thatAlternates.get(i);
      if (!hasAlternate(thatAlternate, eqMethod, eqCache)) {
        return false;
      }
    }
    return true;
  }
boolean checkUnionEquivalenceHelper ( UnionType that , EquivalenceMethod eqMethod , EqCache eqCache ) { List < JSType > thatAlternates = that . getAlternates ( ) ; if ( eqMethod == EquivalenceMethod . IDENTITY && alternates . size ( ) != thatAlternates . size ( ) ) { return false ; } for ( int i = 0 ; i < thatAlternates . size ( ) ; i ++ ) { JSType thatAlternate = thatAlternates . get ( i ) ; if ( ! hasAlternate ( thatAlternate , eqMethod , eqCache ) ) { return false ; } } return true ; }
Two union types are equal if, after flattening nested union types, they have the same number of
 alternates and all alternates are equal.
Two union types are equal if after flattening nested union types they have the same number of alternates and all alternates are equal .