Skip to content

Fix for enums with initialization#128

Open
mingodad wants to merge 2 commits intoalbertodemichelis:masterfrom
mingodad:fix-enum
Open

Fix for enums with initialization#128
mingodad wants to merge 2 commits intoalbertodemichelis:masterfrom
mingodad:fix-enum

Conversation

@mingodad
Copy link
Contributor

@mingodad mingodad commented Jan 8, 2018

There is a bug in squirrel on enums with initialization see the example bellow:

enum option_type { OPT_FLAG=1,  OPT_INT,  OPT_DBL,  OPT_STR,
         OPT_FFLAG, OPT_FINT, OPT_FDBL, OPT_FSTR};

print("\nOPT_FLAG " + option_type.OPT_FLAG);
print("\nOPT_INT " + option_type.OPT_INT);
print("\nOPT_DBL " + option_type.OPT_DBL);

Without the fix the output is:

OPT_FLAG 1
OPT_INT 0
OPT_DBL 1

With the fix:

OPT_FLAG 1
OPT_INT 2
OPT_DBL 3

Cheers !

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

Successfully merging this pull request may close these issues.

1 participant