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

Add support for enums with custom integer types #696

Open
BHolman-LBI opened this issue Apr 4, 2022 · 2 comments
Open

Add support for enums with custom integer types #696

BHolman-LBI opened this issue Apr 4, 2022 · 2 comments
Labels
enhancement New feature or request will take a while This will take a while

Comments

@BHolman-LBI
Copy link
Contributor

Describe the bug
Unsure if this is a bug or a feature request:

The following snippet compiles and triggers a heap corruption runtime check on MSVC

enum class ETest : uint8_t
{
    A, B
};
int main()
{
    
    flecs::world ecs;

    ecs.component<ETest>();
    ecs.entity().set<ETest>(1);
    return 0;
}

Expected behavior
I don't think the above should be allowed to compile?

@BHolman-LBI BHolman-LBI added the bug Something isn't working label Apr 4, 2022
@SanderMertens SanderMertens added enhancement New feature or request and removed bug Something isn't working labels Apr 5, 2022
@SanderMertens SanderMertens changed the title Setting an enum type causes heap corruption Add support for enums with custom integer types Apr 5, 2022
@SanderMertens
Copy link
Owner

Updated the description, this is not currently supported. Will look into why it crashes though, that's not nice.

@SanderMertens
Copy link
Owner

Added an assert that checks if the enum is of the correct size.

@SanderMertens SanderMertens added the will take a while This will take a while label Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request will take a while This will take a while
Projects
None yet
Development

No branches or pull requests

3 participants
@SanderMertens @BHolman-LBI and others