diff options
| author | Pierre-Marie Pédrot | 2021-02-22 14:58:38 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2021-02-22 14:58:38 +0100 |
| commit | 0ee4a8903597527d3872471c87064d9645c9a91b (patch) | |
| tree | 4b6dc82300c7abfdd60fbf78d2875d3e3cd10a9a | |
| parent | 3d1e3d41ac124a02902614317e6318d6cf7a3c38 (diff) | |
| parent | 528f17f9cbd58bee113e6dabd86110ffd57fd243 (diff) | |
Merge PR #13836: Make detyping more resistent in the debugger
Reviewed-by: ppedrot
| -rw-r--r-- | pretyping/detyping.ml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pretyping/detyping.ml b/pretyping/detyping.ml index c5f23482c7..48f34e7c6b 100644 --- a/pretyping/detyping.ml +++ b/pretyping/detyping.ml @@ -930,10 +930,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) |
