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

IntEnum Trait "Does Not Take Parameters" Error #1136

Closed
etspaceman opened this issue Aug 7, 2023 · 4 comments · Fixed by #1138
Closed

IntEnum Trait "Does Not Take Parameters" Error #1136

etspaceman opened this issue Aug 7, 2023 · 4 comments · Fixed by #1138
Assignees

Comments

@etspaceman
Copy link
Contributor

Given a trait defined as:

@trait(selector: ":is(string, blob, member:test( > :is(string, blob)))")
intEnum someTrait {
    FIRST = 1,
    SECOND = 2,
    THIRD = 3,
    FOURTH = 4,
    FIFTH = 5
}

And a usage defined as:

@someTrait(5)
string SomeString

Errors are received when generating:

SomeTrait.type does not take parameters
SomeTrait(5)

Seems it should be using SomeTrait.FIFTH rather than SomeTrait(5) (or something similar).

@lewisjkl
Copy link
Contributor

lewisjkl commented Aug 7, 2023

Thanks for reporting, I should have some time to look at this tomorrow and will report back with what I find and hopefully a PR to fix.

@lewisjkl lewisjkl self-assigned this Aug 7, 2023
@kubukoz
Copy link
Member

kubukoz commented Aug 7, 2023

Does this affect normal enums too?

@etspaceman
Copy link
Contributor Author

I suspect that it does but I have not tested it

@lewisjkl
Copy link
Contributor

lewisjkl commented Aug 8, 2023

I'll test that out too while I'm at it.

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 a pull request may close this issue.

3 participants