pawn-lang / compiler

Pawn compiler for SA-MP with bug fixes and new features - runs on Windows, Linux, macOS
Other
303 stars 70 forks source link

State specifications aren't ignored in old-style function declarations #632

Closed Daniel-Cortez closed 3 years ago

Daniel-Cortez commented 3 years ago

Issue description:

When adding a state specification into a new-style (forward) declaration, the compiler prints warning 231

forward Func() <auto1:st1>; // warning 231: state specification on forward declaration is ignored

, but it doesn't do the same for old-style declarations:

public Func() <auto1:st1>; // no warnings

Moreover, the compiler assigns the specified state to the function and, as a result, doesn't allow to actually define the function with that state.

public Func() <auto1:st1>;
public Func() <auto1:st1> {} // error 084: state conflict: one of the states is already assigned to another implementation (symbol "Func")

Minimal complete verifiable example (MCVE):

See above.

Workspace Information:

Daniel-Cortez commented 3 years ago

Fixed in #633.