diff --git a/src/extension/infer.rs b/src/extension/infer.rs index 7a1b03cfb..cd41a3cfe 100644 --- a/src/extension/infer.rs +++ b/src/extension/infer.rs @@ -285,6 +285,10 @@ impl UnificationContext { // The function that it contains, however, may have an // extension delta, so its output shouldn't be equal to the // FuncDefn's output. + // + // TODO: Add a constraint that the extensions of the output + // node of a FuncDefn should be those of the input node plus + // the extension delta specified in the function signature. if node_type.tag() != OpTag::FuncDefn { self.add_constraint(m_output_node, Constraint::Equal(m_output)); } diff --git a/src/extension/infer/test.rs b/src/extension/infer/test.rs index 8f51e6236..f748c4570 100644 --- a/src/extension/infer/test.rs +++ b/src/extension/infer/test.rs @@ -966,6 +966,11 @@ fn sccs() { } #[test] +/// Note: This test is relying on the builder's `define_function` doing the +/// right thing: it takes input resources via a [`Signature`], which it passes +/// to `create_with_io`, creating concrete resource sets. +/// Inference can still fail for a valid FuncDefn hugr created without using +/// the builder API. fn simple_funcdefn() -> Result<(), Box> { let mut builder = ModuleBuilder::new(); let mut func_builder = builder.define_function(