Skip to content

Commit b077e32

Browse files
committed
Nice error message when an inductive has no registered translation
1 parent 33ac056 commit b077e32

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/parametricity.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,12 @@ and translate_constructor order env evdr ((ind, i), u) =
530530
mkConstructU ((ind, i), u)
531531

532532
and translate_case_info order env ci =
533+
let ci_ind =
534+
try Globnames.destIndRef (Relations.get_inductive order ci.ci_ind)
535+
with Not_found -> error (Pp.str (Printf.sprintf "The inductive '%s' has no registered translation."
536+
(KerName.to_string (MutInd.user (fst ci.ci_ind))))) in
533537
{
534-
ci_ind = Globnames.destIndRef (Relations.get_inductive order ci.ci_ind);
538+
ci_ind = ci_ind;
535539
ci_npar = (order + 1) * ci.ci_npar;
536540
ci_cstr_ndecls = Array.map (fun x -> (order + 1) * x) ci.ci_cstr_ndecls;
537541
ci_cstr_nargs = Array.map (fun x -> (order + 1) * x) ci.ci_cstr_nargs;

0 commit comments

Comments
 (0)