Skip to content

Commit

Permalink
doc: Add comments specifying the limitations of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
croyzor committed Nov 16, 2023
1 parent cfd51f8 commit 31d2d54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/extension/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
5 changes: 5 additions & 0 deletions src/extension/infer/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<dyn Error>> {
let mut builder = ModuleBuilder::new();
let mut func_builder = builder.define_function(
Expand Down

0 comments on commit 31d2d54

Please sign in to comment.