aboutsummaryrefslogtreecommitdiff
path: root/lib/dyn.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2015-12-05 13:43:07 +0100
committerPierre-Marie Pédrot2015-12-05 13:52:18 +0100
commit126a3c998c62bfd9f9b570f12b2e29576dd94cdd (patch)
treeab612a3f64d22162f2a7836cf99d963888923bff /lib/dyn.ml
parent895d34a264d9d90adfe4f0618c3bb0663dc01615 (diff)
Factorizing unsafe code by relying on the new Dyn module.
Diffstat (limited to 'lib/dyn.ml')
-rw-r--r--lib/dyn.ml10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/dyn.ml b/lib/dyn.ml
index 0571f3b5d6..826cfaf8db 100644
--- a/lib/dyn.ml
+++ b/lib/dyn.ml
@@ -6,9 +6,6 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-open Errors
-open Pp
-
module type S =
sig
type 'a tag
@@ -39,8 +36,8 @@ let create (s : string) =
let () =
if Int.Map.mem hash !dyntab then
let old = Int.Map.find hash !dyntab in
- let msg = str "Dynamic tag collision: " ++ str s ++ str " vs. " ++ str old in
- anomaly ~label:"Dyn.create" msg
+ let () = Printf.eprintf "Dynamic tag collision: %s vs. %s\n%!" s old in
+ assert false
in
let () = dyntab := Int.Map.add hash s !dyntab in
hash
@@ -51,7 +48,8 @@ let eq : 'a 'b. 'a tag -> 'b tag -> ('a, 'b) CSig.eq option =
let repr s =
try Int.Map.find s !dyntab
with Not_found ->
- anomaly (str "Unknown dynamic tag " ++ int s)
+ let () = Printf.eprintf "Unknown dynamic tag %i\n%!" s in
+ assert false
let dump () = Int.Map.bindings !dyntab