src/HOL/Tools/BNF/bnf_lift.ML
changeset 62690 c4fad0569a24
parent 62621 a1e73be79c0b
child 62777 596baa1a3251
--- a/src/HOL/Tools/BNF/bnf_lift.ML	Tue Mar 22 08:00:15 2016 +0100
+++ b/src/HOL/Tools/BNF/bnf_lift.ML	Tue Mar 22 08:00:33 2016 +0100
@@ -61,6 +61,9 @@
     val tvs = AbsT |> dest_Type |> snd |> map (fst o dest_TVar);
     val alpha0s = map (TFree o snd) specs;
 
+    val _ = length tvs = length alpha0s orelse
+      error ("Expected " ^ string_of_int (length tvs) ^ " type argument(s) to " ^ quote AbsT_name);
+
     (* instantiate the new type variables newtvs to oldtvs *)
     val subst = subst_TVars (tvs ~~ alpha0s);
     val typ_subst = typ_subst_TVars (tvs ~~ alpha0s);