Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packed string access in enum arrays #710

Open
badabingbadabooom opened this issue Apr 13, 2022 · 0 comments
Open

Packed string access in enum arrays #710

badabingbadabooom opened this issue Apr 13, 2022 · 0 comments

Comments

@badabingbadabooom
Copy link

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:

  • Compiler version: 3.10.10
  • Command line arguments provided (or sampctl version): None
  • Operating System: Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant