Skip to content

Commit

Permalink
fix: Use given input extensions in define_function (#524)
Browse files Browse the repository at this point in the history
`define_function` is passed a `NodeType` which contains information
about input extensions. It uses this to inform the input extensions of
I/O nodes, but wasn't using it for the parent node until now.
  • Loading branch information
croyzor authored Sep 12, 2023
1 parent bc9692b commit a18b268
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/builder/build_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,13 @@ pub trait Container {
name: impl Into<String>,
signature: Signature,
) -> Result<FunctionBuilder<&mut Hugr>, BuildError> {
let f_node = self.add_child_op(ops::FuncDefn {
name: name.into(),
signature: signature.clone().into(),
})?;
let f_node = self.add_child_node(NodeType::new(
ops::FuncDefn {
name: name.into(),
signature: signature.signature.clone(),
},
signature.input_extensions.clone(),
))?;

let db = DFGBuilder::create_with_io(
self.hugr_mut(),
Expand Down

0 comments on commit a18b268

Please sign in to comment.