aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Tassi2020-10-09 09:52:42 +0200
committerEnrico Tassi2020-10-09 09:52:42 +0200
commit1363a6f3702a7b4428ff1b8c9c7ffd1446918201 (patch)
tree61c5c3948e44a85835fc56208fdc423d83e3d26b
parent39fe24769d18c21379f1123754fd606cdf8cd4c8 (diff)
[printing] make detyping resilient to "let x : _ := t in"
-rw-r--r--pretyping/detyping.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/pretyping/detyping.ml b/pretyping/detyping.ml
index 7fcb0795bd..889a30fd76 100644
--- a/pretyping/detyping.ml
+++ b/pretyping/detyping.ml
@@ -883,7 +883,9 @@ and detype_binder d flags bk avoid env sigma decl c =
| BLetIn ->
let c = detype d { flags with flg_isgoal = false } avoid env sigma (Option.get body) in
(* Heuristic: we display the type if in Prop *)
- let s = try Retyping.get_sort_family_of (snd env) sigma ty with _ when !Flags.in_debugger || !Flags.in_toplevel -> InType (* Can fail because of sigma missing in debugger *) in
+ let s =
+ try Retyping.get_sort_family_of (snd env) sigma ty
+ with Retyping.RetypeError _ -> InType (* eg: the type is an evar *) in
let t = if s != InProp && not !Flags.raw_print then None else Some (detype d { flags with flg_isgoal = false } avoid env sigma ty) in
GLetIn (na', c, t, r)