aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/nativenorm.ml5
-rw-r--r--pretyping/vnorm.ml6
2 files changed, 7 insertions, 4 deletions
diff --git a/pretyping/nativenorm.ml b/pretyping/nativenorm.ml
index 0ecbfdbb4c..6af9ff3233 100644
--- a/pretyping/nativenorm.ml
+++ b/pretyping/nativenorm.ml
@@ -167,8 +167,9 @@ let rec nf_val env v typ =
let lvl = nb_rel env in
let name,dom,codom =
try decompose_prod env typ
- with _ -> (* TODO: is this the right exception to raise? *)
- raise (Type_errors.TypeError(env,Type_errors.ReferenceVariables typ))
+ with Invalid_argument _ ->
+ Errors.anomaly
+ (Pp.strbrk "Returned a functional value in a type not recognized as a product type.")
in
let env = push_rel (name,None,dom) env in
let body = nf_val env (f (mk_rel_accu lvl)) codom in
diff --git a/pretyping/vnorm.ml b/pretyping/vnorm.ml
index 82eccab96d..b18719cc27 100644
--- a/pretyping/vnorm.ml
+++ b/pretyping/vnorm.ml
@@ -249,8 +249,10 @@ and nf_fun env f typ =
let vb = body_of_vfun k f in
let name,dom,codom =
try decompose_prod env typ
- with _ ->
- raise (Type_errors.TypeError(env,Type_errors.ReferenceVariables typ))
+ with Invalid_argument _ ->
+ (* 27/2/13: Turned this into an anomaly *)
+ Errors.anomaly
+ (Pp.strbrk "Returned a functional value in a type not recognized as a product type.")
in
let body = nf_val (push_rel (name,None,dom) env) vb codom in
mkLambda(name,dom,body)