fix common comps bug
@@ -77,7 +77,10 @@ fn has_conflicts(
comps2: &[ast::Id],
st: &StructureGraph,
) -> Result<bool, errors::Error> {
- Ok(comps2
+ Ok(
+ // check if comps1 shows up in comps2 ever
+ comps1.iter().any(|id| comps2.contains(id))
+ || comps2
.iter()
.map(|en_comp| st.get_inst_index(en_comp))
// If any of the get_inst_index failed, return the error.
@@ -90,9 +93,12 @@ fn has_conflicts(
st.graph[idx].out_ports().any(|port| {
st.connected_to(idx, port.to_string())
.chain(st.connected_from(idx, port.to_string()))
- .any(|(node_data, _)| comps1.contains(node_data.get_name()))
+ .any(|(node_data, _)| {
+ comps1.contains(node_data.get_name())
})
- }))
+ })
+ }),
+ )
}
impl Visitor for AutomaticPar {
