diff options
author | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2014-11-18 10:18:00 +0100 |
---|---|---|
committer | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2014-11-18 10:26:21 +0100 |
commit | 2e3ae20fe1ed3d7238286720c302bc892505caae (patch) | |
tree | 74fbaa4ee461bb19b1a349c43c3d2d82dc9005a4 /toplevel/himsg.ml | |
parent | 8d26a1d9a3846c6cbe92a9b2f17ffac6fd7d48f5 (diff) |
Fixing a little bug with nested but convertible occurrences in "destruct at".
Diffstat (limited to 'toplevel/himsg.ml')
-rw-r--r-- | toplevel/himsg.ml | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/toplevel/himsg.ml b/toplevel/himsg.ml index 4ca22640d..44e98a513 100644 --- a/toplevel/himsg.ml +++ b/toplevel/himsg.ml @@ -680,15 +680,17 @@ let pr_position (cl,pos) = int pos ++ clpos let explain_cannot_unify_occurrences env sigma nested ((cl2,pos2),t2) ((cl1,pos1),t1) e = - let s = if nested then "Found nested occurrences of the pattern" - else "Found incompatible occurrences of the pattern" in - let ppreason = match e with None -> mt() | Some (c1,c2,e) -> explain_unification_error env sigma c1 c2 (Some e) in - str s ++ str ":" ++ - spc () ++ str "Matched term " ++ pr_lconstr_env env sigma t2 ++ - strbrk " at position " ++ pr_position (cl2,pos2) ++ - strbrk " is not compatible with matched term " ++ - pr_lconstr_env env sigma t1 ++ strbrk " at position " ++ - pr_position (cl1,pos1) ++ ppreason ++ str "." + if nested then + str "Found nested occurrences of the pattern at positions " ++ + int pos1 ++ strbrk " and " ++ pr_position (cl2,pos2) ++ str "." + else + let ppreason = match e with None -> mt() | Some (c1,c2,e) -> explain_unification_error env sigma c1 c2 (Some e) in + str "Found incompatible occurrences of the pattern" ++ str ":" ++ + spc () ++ str "Matched term " ++ pr_lconstr_env env sigma t2 ++ + strbrk " at position " ++ pr_position (cl2,pos2) ++ + strbrk " is not compatible with matched term " ++ + pr_lconstr_env env sigma t1 ++ strbrk " at position " ++ + pr_position (cl1,pos1) ++ ppreason ++ str "." let pr_constraints printenv env sigma evars cstrs = let (ev, evi) = Evar.Map.choose evars in |