Ejemplo n.º 1
0
 InferredType duplicate() {
   List<InferredType> newBranches = new ArrayList<InferredType>();
   for (InferredType branch : unionTypes) {
     newBranches.add(branch.duplicate());
   }
   return new UnionType(newBranches);
 }
Ejemplo n.º 2
0
 InferredType duplicate() {
   List<InferredType> newElts = new ArrayList<InferredType>();
   for (InferredType elt : structTypes) {
     newElts.add(elt.duplicate());
   }
   return new StructType(newElts);
 }