diff options
author | Maxime Dénès <mail@maximedenes.fr> | 2015-07-09 10:32:17 +0200 |
---|---|---|
committer | Maxime Dénès <mail@maximedenes.fr> | 2015-07-09 10:34:05 +0200 |
commit | 1bf30962d7cd5732393d7722ae6d263d4c812ec8 (patch) | |
tree | a9c0cd96b6535bc8accc2579a998197d8a525524 /pretyping | |
parent | 7bda7d7070fc55fc38fef4c21557ea61b0c4d17d (diff) |
Make retyping of projections more resilient to wrong environment.
Unfortunately, it seems that retyping can be called in ill-typed terms and/or in
the wrong environment. This was broken for projections by my commit
a51cce369b9c634a93120092d4c7685a242d55b1
Diffstat (limited to 'pretyping')
-rw-r--r-- | pretyping/retyping.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pretyping/retyping.ml b/pretyping/retyping.ml index 743bc3b19..fb5526552 100644 --- a/pretyping/retyping.ml +++ b/pretyping/retyping.ml @@ -126,9 +126,11 @@ let retype ?(polyprop=true) sigma = | App(f,args) -> strip_outer_cast (subst_type env sigma (type_of env f) (Array.to_list args)) - | Proj (p,c) -> + | Proj (p,c) -> let ty = type_of env c in - Inductiveops.type_of_projection_knowing_arg env sigma p c ty + (try + Inductiveops.type_of_projection_knowing_arg env sigma p c ty + with Invalid_argument _ -> retype_error BadRecursiveType) | Cast (c,_, t) -> t | Sort _ | Prod _ -> mkSort (sort_of env cstr) |