From b40a928259fba6c22eb70909ab5e86681ad2ec61 Mon Sep 17 00:00:00 2001 From: herbelin Date: Wed, 17 Apr 2013 15:00:23 +0000 Subject: Improving error message in explain_cannot_find_well_typed_abstraction: make head bound variables distinct from the variables in environment, so that the naming scheme is the same when, say, printing "fun x:B => foo x" in environment "x:A" (main error with explicit "fun") and when printing (secondary error in the "reason" message) "foo x" in environment "x:A, x:B" (i.e. with "fun" discharged in environment). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16415 85f007b7-540e-0410-9357-904b9bb8a0f7 --- printing/printer.ml | 3 +++ printing/printer.mli | 2 ++ toplevel/himsg.ml | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/printing/printer.ml b/printing/printer.ml index ac7761994b..531614e505 100644 --- a/printing/printer.ml +++ b/printing/printer.ml @@ -47,6 +47,9 @@ let pr_lconstr_core goal_concl_style env t = let pr_lconstr_env env = pr_lconstr_core false env let pr_constr_env env = pr_constr_core false env +let pr_lconstr_goal_style_env env = pr_lconstr_core true env +let pr_constr_goal_style_env env = pr_constr_core true env + let pr_open_lconstr_env env (_,c) = pr_lconstr_env env c let pr_open_constr_env env (_,c) = pr_constr_env env c diff --git a/printing/printer.mli b/printing/printer.mli index 2bc589b63c..b99a9f9ab4 100644 --- a/printing/printer.mli +++ b/printing/printer.mli @@ -28,9 +28,11 @@ open Tacexpr val pr_lconstr_env : env -> constr -> std_ppcmds val pr_lconstr : constr -> std_ppcmds +val pr_lconstr_goal_style_env : env -> constr -> std_ppcmds val pr_constr_env : env -> constr -> std_ppcmds val pr_constr : constr -> std_ppcmds +val pr_constr_goal_style_env : env -> constr -> std_ppcmds (** Same, but resilient to [Nametab] errors. Prints fully-qualified names when [shortest_qualid_of_global] has failed. Prints "??" diff --git a/toplevel/himsg.ml b/toplevel/himsg.ml index 5aa9c80362..b289bb9b09 100644 --- a/toplevel/himsg.ml +++ b/toplevel/himsg.ml @@ -503,7 +503,7 @@ let explain_cannot_find_well_typed_abstraction env p l e = str "Abstracting over the " ++ str (String.plural (List.length l) "term") ++ spc () ++ hov 0 (pr_enum (pr_lconstr_env env) l) ++ spc () ++ - str "leads to a term" ++ spc () ++ pr_lconstr_env env p ++ spc () ++ + str "leads to a term" ++ spc () ++ pr_lconstr_goal_style_env env p ++ spc () ++ str "which is ill-typed." ++ (match e with None -> mt () | Some e -> fnl () ++ str "Reason is: " ++ e) -- cgit v1.2.3