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
fb963851
Commit
fb963851
authored
Jul 10, 2007
by
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
Changes
1
Show whitespace changes
Inline
Side-by-side
typing/typer.ml
View file @
fb963851
...
@@ -749,12 +749,18 @@ and pat_node s : Patterns.node =
...
@@ -749,12 +749,18 @@ and pat_node s : Patterns.node =
(* For the toplevel ... *)
(* For the toplevel ... *)
module
Ids
=
Set
.
Make
(
Id
)
let
type_defs
env
b
=
let
type_defs
env
b
=
List
.
iter
ignore
(
fun
(
v
,
p
)
->
(
List
.
fold_left
if
Env
.
mem
v
env
.
ids
(
fun
seen
(
v
,
p
)
->
then
raise_loc_generic
p
.
loc
(
"Identifier "
^
(
Ident
.
to_string
v
)
^
" is already bound"
)
if
Ids
.
mem
v
seen
then
)
b
;
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
penv
=
derecurs_def
(
penv
env
)
b
in
let
b
=
List
.
map
(
fun
(
v
,
p
)
->
(
v
,
p
,
compile
(
derecurs
penv
p
)))
b
in
let
b
=
List
.
map
(
fun
(
v
,
p
)
->
(
v
,
p
,
compile
(
derecurs
penv
p
)))
b
in
flush_defs
()
;
flush_defs
()
;
...
...
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