aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorGaëtan Gilbert2021-02-08 13:04:18 +0100
committerGaëtan Gilbert2021-02-08 13:04:18 +0100
commit528f17f9cbd58bee113e6dabd86110ffd57fd243 (patch)
tree342e829fc4f496999faf41aa63c2b53df73a7733 /pretyping
parent16765871394a81975047b37f15a902fcc112dc40 (diff)
Make detyping more resistent in the debugger
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/detyping.ml10
1 files changed, 6 insertions, 4 deletions
diff --git a/pretyping/detyping.ml b/pretyping/detyping.ml
index 722a0a2048..e6cb405a80 100644
--- a/pretyping/detyping.ml
+++ b/pretyping/detyping.ml
@@ -928,10 +928,12 @@ and detype_binder d flags bk avoid env sigma decl c =
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 =
- (* It can fail if ty is an evar, or if run inside ocamldebug or the
- OCaml toplevel since their printers don't have access to the proper sigma/env *)
- try Retyping.get_sort_family_of (snd env) sigma ty
- with Retyping.RetypeError _ -> InType
+ if !Flags.in_debugger then InType
+ else
+ (* It can fail if ty is an evar, or if run inside ocamldebug or the
+ OCaml toplevel since their printers don't have access to the proper sigma/env *)
+ try Retyping.get_sort_family_of (snd env) sigma ty
+ with Retyping.RetypeError _ -> InType
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)