Skip to content

Commit

Permalink
Address nits
Browse files Browse the repository at this point in the history
  • Loading branch information
croyzor committed Apr 16, 2024
1 parent 266eb41 commit 1be8c09
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hugr/src/extension/op_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,22 +641,22 @@ mod test {
use crate::extension::prelude::{BOOL_T, PRELUDE_REGISTRY};

let mut e = Extension::new(EXT_ID);
let ext_id = e.name().clone();

let es = ExtensionSet::singleton(&ext_id);
let params: Vec<TypeParam> = vec![TypeParam::Extensions];
let args = [TypeArg::Extensions { es: es.clone() }];
let mut db_set = ExtensionSet::new();
db_set.insert_type_var(0);
let db_set = ExtensionSet::type_var(0);
let fun_ty = FunctionType::new_endo(vec![BOOL_T]).with_extension_delta(db_set);

let exp_fun_ty = FunctionType::new_endo(vec![BOOL_T]).with_extension_delta(es);

let def = e.add_op(
"SimpleOp".into(),
"".into(),
PolyFuncType::new(params.clone(), fun_ty),
)?;

// Concrete extension set
let es = ExtensionSet::singleton(&EXT_ID);
let exp_fun_ty = FunctionType::new_endo(vec![BOOL_T]).with_extension_delta(es.clone());
let args = [TypeArg::Extensions { es }];

def.validate_args(&args, &PRELUDE_REGISTRY, &params)
.unwrap();
assert_eq!(
Expand Down

0 comments on commit 1be8c09

Please sign in to comment.