don't try to register code equations in a locale with assumptions
authorblanchet
Mon, 02 Dec 2013 20:31:54 +0100
changeset 54617 1183bd511980
parent 54616 a21a2223c02b
child 54618 e78e7df36690
don't try to register code equations in a locale with assumptions
src/HOL/Tools/ctr_sugar.ML
--- a/src/HOL/Tools/ctr_sugar.ML	Mon Dec 02 20:31:54 2013 +0100
+++ b/src/HOL/Tools/ctr_sugar.ML	Mon Dec 02 20:31:54 2013 +0100
@@ -932,8 +932,9 @@
                  (Morphism.term phi casex) (map (Morphism.term phi) ctrs))
          |> Local_Theory.notes (anonymous_notes @ notes) |> snd
          |> register_ctr_sugar fcT_name ctr_sugar
-         |> Local_Theory.background_theory
-           (add_ctr_code fcT_name As (map dest_Const ctrs) inject_thms distinct_thms case_thms))
+         |> null (Thm.hyps_of (hd case_thms))
+           ? Local_Theory.background_theory
+             (add_ctr_code fcT_name As (map dest_Const ctrs) inject_thms distinct_thms case_thms))
       end;
   in
     (goalss, after_qed, lthy')