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
af780bcc
Commit
af780bcc
authored
Sep 19, 2014
by
Pietro Abate
Browse files
raise an error instead of a warning on malformed types definitions
parent
f5ca7313
Changes
1
Hide whitespace changes
Inline
Side-by-side
typing/typer.ml
View file @
af780bcc
...
...
@@ -464,9 +464,10 @@ module IType = struct
warning
loc
(
"This definition yields an empty type for "
^
(
U
.
to_string
v
));
if
(
List
.
length
vars
)
<>
(
List
.
length
pl
)
then
warning
loc
(
"Definition of type"
^
(
U
.
to_string
v
)
^
" contains unused/undeclared type variables"
);
error
loc
(
Printf
.
sprintf
"Definition of type %s contains unused/undeclared type variables"
(
U
.
to_string
v
)
);
let
al
=
let
a
=
Array
.
make
(
List
.
length
pl
)
(
Var
.
mk
"dummy"
)
in
(* XXX here I use pervasive.compare instead of string compare *)
...
...
@@ -474,7 +475,7 @@ module IType = struct
a
in
(
v'
,
t
,
al
)
)
b
b'
)
(
List
.
rev
b
)
(
List
.
rev
b'
)
in
List
.
iter
(
fun
(
v
,
t
,
al
)
->
Types
.
Print
.
register_global
(
""
,
v
,
Array
.
map
Types
.
var
al
)
t
...
...
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