Skip to content

Commit

Permalink
fix: inline_constant_functions not connecting LoadFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-q committed Sep 23, 2024
1 parent 95606e4 commit c50bf6e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/utils/inline_constant_functions.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use hugr::{
extension::ExtensionRegistry,
hugr::hugrmut::HugrMut,
ops::{FuncDefn, LoadFunction, Value},
types::PolyFuncType,
HugrView, Node, NodeIndex as _,
extension::ExtensionRegistry, hugr::hugrmut::HugrMut, ops::{FuncDefn, LoadFunction, Value}, types::PolyFuncType, HugrView, IncomingPort, Node, NodeIndex as _
};

use anyhow::{anyhow, bail, Result};
Expand Down Expand Up @@ -75,10 +71,12 @@ fn inline_constant_functions_impl(
hugr.insert_hugr(func_node, func_hugr);

for lcn in load_constant_ns {
hugr.disconnect(lcn, IncomingPort::from(0));
hugr.replace_op(
lcn,
LoadFunction::try_new(polysignature.clone(), [], registry)?,
)?;
hugr.connect(func_node, 0, lcn, 0);
}
any_changes = true;
}
Expand Down

0 comments on commit c50bf6e

Please sign in to comment.