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

[r2005-07-08 13:21:03 by afrisch] Accept nested record merges in types

Original author: afrisch
Date: 2005-07-08 13:21:03+00:00
parent 966f68ef
......@@ -600,7 +600,7 @@ open Ident
n.desc <- ILink (elim_conc a b)
| IMerge (a,b) ->
if (n.sid > 0)
then raise (Patterns.Error "Ill-formed concatenation loop");
then raise (Patterns.Error "Ill-formed merge loop");
n.sid <- 1;
n.desc <- ILink (elim_merge a b)
| _ -> ()
......@@ -619,7 +619,11 @@ open Ident
mk_record (o1||o2) (LabelMap.merge (fun _ x -> x) l1 l2) in
(* Problem: repr can loop with ill-formed recursion.
type t = s + t where s = s | s;; *)
match (repr a).desc, (repr b).desc with
let a = repr a and b = repr b in
elim_concat a; elim_concat b;
let a = repr a and b = repr b in
match a.desc, b.desc with
| IType (t1,_), IType (t2,_) ->
if not (Types.subtype t1 Types.Record.any) then
raise
......
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