more accurate check of judgment type
authorhaftmann
Tue, 21 Jul 2009 15:44:31 +0200
changeset 32122 4ee1c1aebbcc
parent 32121 a7bc3141e599
child 32123 8bac9ee4b28d
more accurate check of judgment type
src/Pure/Isar/code.ML
--- a/src/Pure/Isar/code.ML	Tue Jul 21 15:44:30 2009 +0200
+++ b/src/Pure/Isar/code.ML	Tue Jul 21 15:44:31 2009 +0200
@@ -801,7 +801,9 @@
      of SOME T_class => T_class
       | _ => error ("Bad certificate: " ^ Display.string_of_thm thm);
     val tvar = case try Term.dest_TVar T
-     of SOME tvar => tvar
+     of SOME (tvar as (_, sort)) => if null (filter (can (AxClass.get_info thy)) sort)
+          then tvar
+          else error ("Bad sort: " ^ Display.string_of_thm thm)
       | _ => error ("Bad type: " ^ Display.string_of_thm thm);
     val _ = if Term.add_tvars eqn [] = [tvar] then ()
       else error ("Inconsistent type: " ^ Display.string_of_thm thm);