From 528f17f9cbd58bee113e6dabd86110ffd57fd243 Mon Sep 17 00:00:00 2001 From: Gaƫtan Gilbert Date: Mon, 8 Feb 2021 13:04:18 +0100 Subject: Make detyping more resistent in the debugger --- pretyping/detyping.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'pretyping') 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) -- cgit v1.2.3