From 33435f271509f4888d44f9446b078eeebbe71519 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Tue, 16 Jun 2009 21:58:28 +0000 Subject: [PATCH] Implementation of existential type improved (more strict checking). --- helm/software/components/ng_kernel/nCicLibrary.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helm/software/components/ng_kernel/nCicLibrary.ml b/helm/software/components/ng_kernel/nCicLibrary.ml index 414e5c5de..d28b0da6c 100644 --- a/helm/software/components/ng_kernel/nCicLibrary.ml +++ b/helm/software/components/ng_kernel/nCicLibrary.ml @@ -72,7 +72,7 @@ module type Serializer = module Serializer(S: sig type status end) = struct type status = S.status - type obj = Obj.t + type obj = string * Obj.t let require1 = ref (fun _ -> assert false (* unknown data*)) let already_registered = ref [] @@ -82,14 +82,14 @@ module Serializer(S: sig type status end) = already_registered := tag :: !already_registered; require1 := (fun (tag',data) as x -> - if tag=tag' then Obj.magic require data else Obj.magic !require1 x); - Obj.magic (fun x -> tag,x) + if tag=tag' then require (Obj.magic data) else !require1 x); + (fun x -> tag,Obj.repr x) let serialize = serialize let require ~baseuri status = let dump = require0 ~baseuri in - List.fold_right (Obj.magic !require1) dump status + List.fold_right !require1 dump status end let decompile ~baseuri = -- 2.39.2