let module S = CicSubstitution in
let module U = UriManager in
function
- C.Rel n -> S.lift n (List.nth env (n - 1))
+ C.Rel n ->
+ let t =
+ try
+ List.nth env (n - 1)
+ with
+ _ -> raise (NotWellTyped "Not a close term")
+ in
+ S.lift n t
| C.Var uri ->
incr fdebug ;
let ty = type_of_variable uri in