* @param cdMapF Given c returns Some(d) where d can take an abstract parent and return a class e if c should be replaced by e, and None if c should be kept.
* @param cdMapF Given c returns Some(d) where d can take an abstract parent and return a class e if c should be replaced by e, and None if c should be kept.
* @param fiMapF Given a previous case class invocation and its new case class definition, returns the expression to use.
* @param ciMapF Given a previous case class invocation and its new case class definition, returns the expression to use.
* By default it is the case class construction using the new case class definition.
* By default it is the case class construction using the new case class definition.
* @return the new program with a map from the old case classes to the new case classes */
* @return the new program with a map from the old case classes to the new case classes, with maps concerning identifiers and function definitions. */
caseccd:CaseClassDef=>ccd.duplicate(parent=parent,fields=ccd.fieldsIds.map(id=>ValDef(idMap(id))))// Should not cycle since fields have to be abstract.
caseccd:CaseClassDef=>ccd.duplicate(parent=parent,fields=ccd.fieldsIds.map(id=>ValDef(idMap(id))))// Should not cycle since fields have to be abstract.
}
}
cdMapCache+=cd->new_cd
new_cd
}
}
}
}
// TODO: Do not unnecessarily duplicate the argument types if they don't have to change.