Skip to content

Commit

Permalink
prop_filter for CustomType
Browse files Browse the repository at this point in the history
  • Loading branch information
acl-cqc committed Dec 23, 2024
1 parent f7cca46 commit 86df78d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hugr-core/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,11 @@ pub(crate) mod test {
) -> impl Strategy<Value = (Type, Vec<TypeParam>)> + Clone {
prop_oneof![
// no Alias
MakeCustomType.with_env(vars.clone(), reg.clone()),
MakeCustomType
.with_env(vars.clone(), reg.clone())
.prop_filter("Must fit TypeBound", move |(ct, _)| self
.0
.contains(ct.least_upper_bound())),
MakeFuncType.with_env(vars.clone(), reg.clone()),
make_type_var(self.0.into(), vars.clone()).prop_map(|(ta, vars)| match ta {
TypeArg::Type { ty } => (ty, vars),
Expand Down

0 comments on commit 86df78d

Please sign in to comment.