diff options
author | Stephane Glondu <steph@glondu.net> | 2009-02-19 13:13:14 +0100 |
---|---|---|
committer | Stephane Glondu <steph@glondu.net> | 2009-02-19 13:13:14 +0100 |
commit | a0a94c1340a63cdb824507b973393882666ba52a (patch) | |
tree | 73aa4eb32cbd176379bc91b21c184e2a6882bfe3 /checker/typeops.ml | |
parent | cfbfe13f5b515ae2e3c6cdd97e2ccee03bc26e56 (diff) |
Imported Upstream version 8.2-1+dfsgupstream/8.2-1+dfsg
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 1af8b2ce..1832ebec 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 |