Forgot to check that function parameters are not reserved names.
This commit is contained in:
parent
71474e1b0d
commit
26059c281a
@ -158,10 +158,12 @@ let check_variants variants =
|
|||||||
let check_parameters params =
|
let check_parameters params =
|
||||||
let add acc = function
|
let add acc = function
|
||||||
ParamConst {value; _} ->
|
ParamConst {value; _} ->
|
||||||
|
check_reserved_name value.var;
|
||||||
if VarSet.mem value.var acc then
|
if VarSet.mem value.var acc then
|
||||||
raise (Error (Duplicate_parameter value.var))
|
raise (Error (Duplicate_parameter value.var))
|
||||||
else VarSet.add value.var acc
|
else VarSet.add value.var acc
|
||||||
| ParamVar {value; _} ->
|
| ParamVar {value; _} ->
|
||||||
|
check_reserved_name value.var;
|
||||||
if VarSet.mem value.var acc then
|
if VarSet.mem value.var acc then
|
||||||
raise (Error (Duplicate_parameter value.var))
|
raise (Error (Duplicate_parameter value.var))
|
||||||
else VarSet.add value.var acc in
|
else VarSet.add value.var acc in
|
||||||
|
Loading…
Reference in New Issue
Block a user