?(localise=fun _ -> Stdpp.dummy_loc)
~look_for_coercion (uri,height,metasenv,subst,obj)
=
+prerr_endline ("===============\n" ^ NCicPp.ppobj (uri,height,metasenv,subst,obj));
let check_type metasenv subst context (ty as orig_ty) = (* XXX fattorizza *)
let metasenv, subst, ty, sort =
typeof hdb ~localise ~look_for_coercion metasenv subst context ty None
try snd (HExtlib.split_nth leftno k_relev)
with Failure _ -> k_relev in
let te = NCicTypeChecker.debruijn uri len [] te in
+ let metasenv, subst, te, _ = check_type metasenv subst tys te in
let context,te = NCicReduction.split_prods ~subst tys leftno te in
let _,chopped_context_rev =
HExtlib.split_nth (List.length tys) (List.rev context) in
else
metasenv,subst,item1::context
) (metasenv,subst,[]) sx_context_ty_rev sx_context_te_rev
- with Invalid_argument "List.fold_left2" -> assert false
- in
- let metasenv, subst, te, con_sort =
- check_type metasenv subst context te
- in
+ with Invalid_argument "List.fold_left2" -> assert false in
+ let con_sort= NCicTypeChecker.typeof ~subst ~metasenv context te in
(match
NCicReduction.whd ~subst context con_sort,
NCicReduction.whd ~subst [] ty_sort