From 0bc324c13d1eaaa0de54a4d37098dd669198e17e Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Sat, 19 Apr 2008 16:33:26 +0000 Subject: [PATCH] better error message --- helm/software/components/ng_kernel/nCicTypeChecker.ml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/helm/software/components/ng_kernel/nCicTypeChecker.ml b/helm/software/components/ng_kernel/nCicTypeChecker.ml index 4b00edd05..f6d8d8902 100644 --- a/helm/software/components/ng_kernel/nCicTypeChecker.ml +++ b/helm/software/components/ng_kernel/nCicTypeChecker.ml @@ -1096,16 +1096,12 @@ and check_obj_well_typed (uri,height,metasenv,subst,kind) = assert (metasenv = [] && subst = []); match kind with | C.Constant (_,_,Some te,ty,_) -> -(* - prerr_endline ("TY: " ^ NCicPp.ppterm ~subst ~metasenv ~context:[] ty); - prerr_endline ("BO: " ^ NCicPp.ppterm ~subst ~metasenv ~context:[] te); -*) let _ = typeof ~subst ~metasenv [] ty in let ty_te = typeof ~subst ~metasenv [] te in -(* prerr_endline "XXXX"; *) if not (R.are_convertible ~subst ~metasenv [] ty_te ty) then - raise (TypeCheckerFailure (lazy (Printf.sprintf - "the type of the body is not the one expected:\n%s\nvs\n%s" + raise (TypeCheckerFailure (lazy (Printf.sprintf ( + "the type of the body is not convertible with the declared one.\n"^^ + "inferred type:\n%s\nexpected type:\n%s") (NCicPp.ppterm ~subst ~metasenv ~context:[] ty_te) (NCicPp.ppterm ~subst ~metasenv ~context:[] ty)))) | C.Constant (_,_,None,ty,_) -> ignore (typeof ~subst ~metasenv [] ty) -- 2.39.2