diff options
author | barras <barras@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2009-03-02 17:49:38 +0000 |
---|---|---|
committer | barras <barras@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2009-03-02 17:49:38 +0000 |
commit | dc1f525d12219a43648c449f034fb319bc6c1e7a (patch) | |
tree | f80b2aee7b517f9987dba10f745a8fa1242e435d /checker/typeops.ml | |
parent | 95dcebe76caf6a93289e484995760ec94111c7c8 (diff) |
porting r11900 11905 and 11953 to trunk
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@11954 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'checker/typeops.ml')
-rw-r--r-- | checker/typeops.ml | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/checker/typeops.ml b/checker/typeops.ml index 1af8b2ced..1832ebec4 100644 --- a/checker/typeops.ml +++ b/checker/typeops.ml @@ -140,7 +140,10 @@ let type_of_constant env cst = let judge_of_constant_knowing_parameters env cst paramstyp = let c = Const cst in - let cb = lookup_constant cst env in + let cb = + try lookup_constant cst env + with Not_found -> + failwith ("Cannot find constant: "^string_of_con cst) in let _ = check_args env c cb.const_hyps in type_of_constant_knowing_parameters env cb.const_type paramstyp @@ -222,7 +225,10 @@ let judge_of_cast env (c,cj) k tj = let judge_of_inductive_knowing_parameters env ind (paramstyp:constr array) = let c = Ind ind in - let (mib,mip) = lookup_mind_specif env ind in + let (mib,mip) = + try lookup_mind_specif env ind + with Not_found -> + failwith ("Cannot find inductive: "^string_of_kn (fst ind)) in check_args env c mib.mind_hyps; type_of_inductive_knowing_parameters env mip paramstyp @@ -235,7 +241,10 @@ let judge_of_constructor env c = let constr = Construct c in let _ = let ((kn,_),_) = c in - let mib = lookup_mind kn env in + let mib = + try lookup_mind kn env + with Not_found -> + failwith ("Cannot find inductive: "^string_of_kn (fst (fst c))) in check_args env constr mib.mind_hyps in let specif = lookup_mind_specif env (inductive_of_constructor c) in type_of_constructor c specif |