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

Inferred array of enum doesn't accept enum #1323

Open
luis-soares-sky opened this issue Oct 10, 2024 · 0 comments
Open

Inferred array of enum doesn't accept enum #1323

luis-soares-sky opened this issue Oct 10, 2024 · 0 comments
Milestone

Comments

@luis-soares-sky
Copy link
Contributor

luis-soares-sky commented Oct 10, 2024

bsc-1.0.0-alpha.39

enum MyEnum
    FIRST_PROP = 1
    MY_SECOND = 2
    THIRD_ROCK = 3
    FFFFOUR = 4
    THE_FIFTH = 5
end enum

sub EnumTest()
    ' inferred type looks right, but pushing new items seems to be broken


    arr = [MyEnum.FIRST_PROP]
    arr.push(MyEnum.MY_SECOND)

    ' forcing the type on LHS works
    arr2 as MyEnum[] = [MyEnum.FIRST_PROP]
    arr2.push(MyEnum.MY_SECOND)

    ' doesn't seem to happen with other types
    arr3 = ["str"]
    arr3.push("something else")
end sub

Image

@TwitchBronBron TwitchBronBron added this to the v1.0.0 milestone Oct 10, 2024
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

2 participants