aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2020-12-12 16:48:07 +0100
committerPierre-Marie Pédrot2020-12-12 16:50:48 +0100
commit213f84e60eda94c90436f0102fed00fe579d0a48 (patch)
tree75c477b138f5a4caa70cdeafc731a137584924c3 /pretyping
parent233629e8f6e40057a8caf7502047995427740ae8 (diff)
Tweak constr_matching so as to make it tail-rec on projection expansion.
This was revealed on the rewriter contrib with the compact-case-repr branch.
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/constr_matching.ml7
1 files changed, 3 insertions, 4 deletions
diff --git a/pretyping/constr_matching.ml b/pretyping/constr_matching.ml
index a3f1c0b004..0e69b814c7 100644
--- a/pretyping/constr_matching.ml
+++ b/pretyping/constr_matching.ml
@@ -528,10 +528,9 @@ let sub_match ?(closed=true) env sigma pat c =
let sub = subargs env types @ subargs env' bodies in
try_aux sub next_mk_ctx next
| Proj (p,c') ->
- begin try
- let term = Retyping.expand_projection env sigma p c' [] in
- aux env term mk_ctx next
- with Retyping.RetypeError _ -> next ()
+ begin match Retyping.expand_projection env sigma p c' [] with
+ | term -> aux env term mk_ctx next
+ | exception Retyping.RetypeError _ -> next ()
end
| Array(u, t, def, ty) ->
let next_mk_ctx = function