Open Daniel-Cortez opened 10 months ago
While working on an implementation of named-only function arguments (#719), I found an oversight in function declargs(). https://github.com/pawn-lang/compiler/blob/81b4a0243de40ff7bb38520b33054066e998cdc9/source/compiler/sc1.c#L4278-L4282 There's no check if const was already specified, although handlers for other specifiers (&, Tag:, ...) have this kind of check. As a result, the user can specify const any number of times
declargs()
const
&
Tag:
...
Func(const const const const arg) {}
and the compiler would think this is okay, although it clearly isn't.
See above.
Issue description:
While working on an implementation of named-only function arguments (#719), I found an oversight in function
declargs()
. https://github.com/pawn-lang/compiler/blob/81b4a0243de40ff7bb38520b33054066e998cdc9/source/compiler/sc1.c#L4278-L4282 There's no check ifconst
was already specified, although handlers for other specifiers (&
,Tag:
,...
) have this kind of check. As a result, the user can specifyconst
any number of timesand the compiler would think this is okay, although it clearly isn't.
Minimal complete verifiable example (MCVE):
See above.
Workspace Information: