Commit 9da1d67c authored by Kim Nguyễn's avatar Kim Nguyễn

Add a workaround in case pattern compilation failed (after typechecking) due...

Add a workaround in case pattern compilation failed (after typechecking) due to the presence of type variables in some types.
parent cd7eaf51
This diff is collapsed.
......@@ -3038,6 +3038,19 @@ struct
app_subst t subst
let hide_vars t =
if no_var t then t else
let _,pos, neg, all = Variable.collect_vars t in
let subst = Map.init
(fun v ->
let is_pos = Var.Set.mem pos v in
let is_neg = Var.Set.mem neg v in
if is_pos == is_neg then var v
else if is_pos then any else empty
) all
in
app_subst t subst
end
......
......@@ -160,7 +160,7 @@ module Substitution : sig
val full : t -> (Var.var * t) list -> t
val single : t -> (Var.var * t) -> t
val freshen : Var.Set.t -> t -> t
val hide_vars : t -> t
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment