Skip to content

Commit

Permalink
Revert "implement constraint_ty"
Browse files Browse the repository at this point in the history
This reverts commit 405bfcc.
  • Loading branch information
pigumar1 committed May 4, 2024
1 parent 1ba9e2e commit fd86321
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions src/haz3lcore/statics/Statics.re
Original file line number Diff line number Diff line change
Expand Up @@ -419,23 +419,28 @@ and uexp_to_info_map =
let rules_to_info_map = (rules: list((UPat.t, UExp.t)), m) => {
let (ps, es) = List.split(rules);
let branch_ids = List.map(UExp.rep_id, es);
let rec get_constraint_ty = ps => {
switch (ps) {
| [] => scrut.ty
| [p, ...ps] =>
let (p', _m) =
go_pat(~is_synswitch=false, ~co_ctx=CoCtx.empty, p, m);
switch (Info.pat_ty(p')) {
| Unknown(_) => get_constraint_ty(ps)
| ty => ty
};
};
};
let constraint_ty =
switch (scrut.ty) {
| Unknown(_) => get_constraint_ty(ps)
| _ => scrut.ty
};
// let rec get_scrut_ty = ps => {
// switch (ps) {
// | [] => scrut.ty
// | [p, ...ps] =>
// let (p', _m) =
// go_pat(
// ~is_synswitch=false,
// ~co_ctx=CoCtx.empty,
// p,
// m,
// );
// switch (Info.pat_ty(p')) {
// | Unknown(_) => get_scrut_ty(ps)
// | ty => ty
// };
// };
// };
// let scrut_ty =
// switch (scrut.ty) {
// | Unknown(_) => get_scrut_ty(ps)
// | _ => scrut.ty
// };
let (ps', m) =
map_m(
go_pat(
Expand Down Expand Up @@ -466,7 +471,6 @@ and uexp_to_info_map =
~is_synswitch=false,
~co_ctx,
~mode=Mode.Ana(scrut.ty),
~constraint_ty=Some(constraint_ty),
p,
m,
);
Expand Down

0 comments on commit fd86321

Please sign in to comment.