Skip to content

Commit 69b33d2

Browse files
committed
Fix monomorphize test
1 parent 4dcf9e1 commit 69b33d2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

hugr-passes/src/monomorphize.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,15 +414,14 @@ mod test {
414414
}
415415

416416
#[test]
417-
#[should_panic] // TODO test needs updating: We only mangle link_name, not name, and many here were inner functions.
418417
fn test_multiargs_nats() {
419418
//pf1 contains pf2 contains mono_func -> pf1<a> and pf1<b> share pf2's and they share mono_func
420419

421420
let tv = |i| Type::new_var_use(i, TypeBound::Copyable);
422421
let sv = |i| TypeArg::new_var_use(i, TypeParam::max_nat());
423422
let sa = |n| TypeArg::BoundedNat { n };
424423
let n: u64 = 5;
425-
let mut outer = FunctionBuilder::new(
424+
let mut outer = FunctionBuilder::new_pub(
426425
"mainish",
427426
Signature::new(
428427
ValueArray::ty_parametric(
@@ -441,7 +440,7 @@ mod test {
441440

442441
let mono_func = {
443442
let mut fb = mb
444-
.define_function("get_usz", Signature::new(vec![], usize_t()))
443+
.define_function_pub("get_usz", Signature::new(vec![], usize_t()))
445444
.unwrap();
446445
let cst0 = fb.add_load_value(ConstUsize::new(1));
447446
fb.finish_with_outputs([cst0]).unwrap()
@@ -452,7 +451,7 @@ mod test {
452451
[TypeParam::max_nat(), TypeBound::Copyable.into()],
453452
Signature::new(ValueArray::ty_parametric(sv(0), tv(1)).unwrap(), tv(1)),
454453
);
455-
let mut pf2 = mb.define_function("pf2", pf2t).unwrap();
454+
let mut pf2 = mb.define_function_pub("pf2", pf2t).unwrap();
456455
let [inw] = pf2.input_wires_arr();
457456
let [idx] = pf2.call(mono_func.handle(), &[], []).unwrap().outputs_arr();
458457
let op_def = collections::value_array::EXTENSION.get_op("get").unwrap();
@@ -472,7 +471,7 @@ mod test {
472471
usize_t(),
473472
),
474473
);
475-
let mut pf1 = mb.define_function("pf1", pf1t).unwrap();
474+
let mut pf1 = mb.define_function_pub("pf1", pf1t).unwrap();
476475

477476
// pf1: Two calls to pf2, one depending on pf1's TypeArg, the other not
478477
let inner = pf1
@@ -570,7 +569,7 @@ mod test {
570569

571570
let _main = {
572571
let mut builder = module_builder
573-
.define_function("main", Signature::new_endo(Type::UNIT))
572+
.define_function_pub("main", Signature::new_endo(Type::UNIT))
574573
.unwrap();
575574
let func_ptr = builder
576575
.load_func(foo.handle(), &[Type::UNIT.into()])

0 commit comments

Comments
 (0)