Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
yannham committed Mar 5, 2024
1 parent 2475a77 commit 56eaca5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/src/typ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ impl Subcontract for EnumRows {
// x |> match {
// 'foo => x,
// 'bar => x,
// 'Baz variant_arg => %apply_contract% T label_arg variant_arg,
// 'Baz variant_arg => 'Baz (%apply_contract% T label_arg variant_arg),
// _ => $enum_fail l
// }
// ```
Expand All @@ -991,15 +991,17 @@ impl Subcontract for EnumRows {
});

let body = if let Some(ty) = row.typ.as_ref() {
// %apply_contract% T label_arg variant_arg
mk_app!(
// 'Tag (%apply_contract% T label_arg variant_arg)
let arg = mk_app!(
mk_term::op2(
BinaryOp::ApplyContract(),
ty.subcontract(vars.clone(), pol, sy)?,
mk_term::var(label_arg)
),
mk_term::var(variant_arg)
)
);

Term::EnumVariant { tag: row.id, arg, attrs: Default::default() }.into()
} else {
mk_term::var(value_arg)
};
Expand Down

0 comments on commit 56eaca5

Please sign in to comment.