Commit fb963851 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-05-11 21:45:29 by afrisch] Allow redefinition of type names

Original author: afrisch
Date: 2004-05-11 21:45:29+00:00
parent 6c669a23
......@@ -749,12 +749,18 @@ and pat_node s : Patterns.node =
(* For the toplevel ... *)
module Ids = Set.Make(Id)
let type_defs env b =
List.iter
(fun (v,p) ->
if Env.mem v env.ids
then raise_loc_generic p.loc ("Identifier " ^ (Ident.to_string v) ^ " is already bound")
) b;
ignore
(List.fold_left
(fun seen (v,p) ->
if Ids.mem v seen then
raise_loc_generic p.loc
("Multiple definitions for the type identifer " ^
(Ident.to_string v));
Ids.add v seen
) Ids.empty b);
let penv = derecurs_def (penv env) b in
let b = List.map (fun (v,p) -> (v,p,compile (derecurs penv p))) b in
flush_defs ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment