Merge branch 'rinderknecht-dev' into 'dev'
[PascaLIGO] Forgot to check that function parameters are not reserved names. See merge request ligolang/ligo!384
This commit is contained in:
commit
8232eecc6e
@ -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