fixed two bugs
authorhaftmann
Mon, 23 Oct 2006 11:17:24 +0200
changeset 21094 7e18c11e6267
parent 21093 7ad7a12c0712
child 21095 2c9f73fa973c
fixed two bugs
src/Pure/Tools/class_package.ML
src/Pure/Tools/codegen_serializer.ML
--- a/src/Pure/Tools/class_package.ML	Mon Oct 23 11:05:33 2006 +0200
+++ b/src/Pure/Tools/class_package.ML	Mon Oct 23 11:17:24 2006 +0200
@@ -577,6 +577,7 @@
 
 fun wrap_add_instance_sort (class, sort) thy =
   (if forall (is_some o lookup_class_data thy) (Sign.read_sort thy sort)
+    andalso (is_some o lookup_class_data thy) (Sign.intern_class thy class)
   then instance_sort else axclass_instance_sort) (class, sort) thy;
 
 val class_subP = P.name -- Scan.repeat (P.$$$ "+" |-- P.name) >> (op ::);
--- a/src/Pure/Tools/codegen_serializer.ML	Mon Oct 23 11:05:33 2006 +0200
+++ b/src/Pure/Tools/codegen_serializer.ML	Mon Oct 23 11:17:24 2006 +0200
@@ -909,7 +909,7 @@
     fun deriving_show tyco =
       let
         fun deriv tycos tyco = member (op =) tycos tyco orelse
-          case Graph.get_node code tyco
+          case the_default CodegenThingol.Bot (try (Graph.get_node code) tyco)
            of CodegenThingol.Bot => true
             | CodegenThingol.Datatype (_, cs) => forall (deriv' (tyco :: tycos))
                 (maps snd cs)