Skip to content

Commit

Permalink
fix: Do not require matching extension_reqs when creating a replaceme…
Browse files Browse the repository at this point in the history
…nt from a sibling graph
  • Loading branch information
aborgna-q committed Jun 7, 2024
1 parent 1cdaeed commit 28ef30d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hugr-core/src/hugr/views/sibling_subgraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,12 @@ impl SiblingSubgraph {
let Some([rep_input, rep_output]) = replacement.get_io(rep_root) else {
return Err(InvalidReplacement::InvalidDataflowParent);
};
if dfg_optype.dataflow_signature() != Some(self.signature(hugr)) {

let current_signature = self.signature(hugr);
let new_signature = dfg_optype.dataflow_signature();
if new_signature.as_ref().map(|s| &s.input) != Some(&current_signature.input)
|| new_signature.as_ref().map(|s| &s.output) != Some(&current_signature.output)
{
return Err(InvalidReplacement::InvalidSignature);
}

Expand Down

0 comments on commit 28ef30d

Please sign in to comment.