compiler
compiler copied to clipboard
Function tags conflict with class specifiers in `forward` declarations
Issue description:
The following code compiles correctly:
forward public Func();
But when specifying a tag for the return value, it won't compile
forward public Tag:Func(); // error 010: invalid function or declaration
, although if the class specifier is removed, it would compile just fine:
forward Tag:Func(); // no errors
Minimal complete verifiable example (MCVE):
See above.
Workspace Information:
- Compiler version: 3.10.10, 3.2.3664
- Command line arguments provided (or sampctl version):
- Operating System:
Checked the code in function funcstub() (file sc1.c); apparently the compiler expects the tag before the class specifier (which is obviously a bug), so, for example, this code
forward Tag:public Func();
surprisingly compiles.
Possibly related to https://github.com/pawn-lang/compiler/issues/618 ?
Possibly related to #618 ?
No, that one is related to function arguments, while this bug affects the tag of the function itself. Also, what you described in your issue is intended behavior (although I agree it might seem counter-intuitive at times) while this one clearly isn't.
This issue has been automatically marked as stale because it has not had recent activity.