Skip to content

Commit bafb1f9

Browse files
committed
Nice error message when an inductive has no registered translation
1 parent 7b4ed44 commit bafb1f9

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
@@ -524,8 +524,12 @@ and translate_constructor order env evdr ((ind, i), u) =
524524
mkConstructU ((ind, i), u)
525525

526526
and translate_case_info order env ci =
527+
let ci_ind =
528+
try Globnames.destIndRef (Relations.get_inductive order ci.ci_ind)
529+
with Not_found -> error (Pp.str (Printf.sprintf "The inductive '%s' has no registered translation."
530+
(KerName.to_string (MutInd.user (fst ci.ci_ind))))) in
527531
{
528-
ci_ind = Globnames.destIndRef (Relations.get_inductive order ci.ci_ind);
532+
ci_ind = ci_ind;
529533
ci_npar = (order + 1) * ci.ci_npar;
530534
ci_relevance = ci.ci_relevance;
531535
ci_cstr_ndecls = Array.map (fun x -> (order + 1) * x) ci.ci_cstr_ndecls;

0 commit comments

Comments
 (0)