Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
c661fdbc
Commit
c661fdbc
authored
Jul 10, 2007
by
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
757ef82c
Changes
1
Hide whitespace changes
Inline
Side-by-side
typing/typepat.ml
View file @
c661fdbc
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment