diff options
Diffstat (limited to 'pretyping/retyping.ml')
-rw-r--r-- | pretyping/retyping.ml | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/pretyping/retyping.ml b/pretyping/retyping.ml index a56861c6..fb552655 100644 --- a/pretyping/retyping.ml +++ b/pretyping/retyping.ml @@ -126,14 +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) -> - let Inductiveops.IndType(pars,realargs) = - let ty = type_of env c in - try Inductiveops.find_rectype env sigma ty - with Not_found -> retype_error BadRecursiveType - in - let (_,u), pars = dest_ind_family pars in - substl (c :: List.rev pars) (Typeops.type_of_projection env (p,u)) + | Proj (p,c) -> + let ty = type_of env c in + (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) |