pawn-lang / compiler

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

Packed string access in enum arrays #710

Open badabingbadabooom opened 2 years ago

badabingbadabooom commented 2 years ago

Issue description:

Accessing a packed string in an array that uses an enumerator gives warnings and errors such as:

warning 215: expression has no effect
error 001: expected token: ";", but found "{"       
warning 215: expression has no effect
error 001: expected token: ";", but found "}"       
warning 217: loose indentation
error 029: invalid expression, assumed zero

Minimal complete verifiable example (MCVE):

enum data
{
    packed_string[32 char]
};

main()
{
    new test[data];
    test[packed_string]{0} = '1';
}

Changing the first dimension to 0 or data:0 doesn't fix it either. However, changing the array's declaration to test[1][32 char] works.

Workspace Information: