예제 #1
0
 public InferredType hoistUnions() {
   List<InferredType> newUnionTypes = new ArrayList<InferredType>();
   for (InferredType it : unionTypes) {
     if (it instanceof UnionType) {
       UnionType subUnion = (UnionType) it;
       for (InferredType it2 : subUnion.unionTypes) {
         newUnionTypes.add(it2.hoistUnions());
       }
     } else {
       newUnionTypes.add(it.hoistUnions());
     }
   }
   return new UnionType(newUnionTypes);
 }
예제 #2
0
 public InferredType hoistUnions() {
   List<InferredType> newStructTypes = new ArrayList<InferredType>();
   for (InferredType it : structTypes) {
     newStructTypes.add(it.hoistUnions());
   }
   return new StructType(newStructTypes);
 }
예제 #3
0
 public InferredType hoistUnions() {
   return new ArrayType(bodyType.hoistUnions());
 }