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

False positive Unnecessary semicolon (standard:no-semi) #2771

Closed
vanniktech opened this issue Aug 15, 2024 · 2 comments · Fixed by #2774
Closed

False positive Unnecessary semicolon (standard:no-semi) #2771

vanniktech opened this issue Aug 15, 2024 · 2 comments · Fixed by #2774
Milestone

Comments

@vanniktech
Copy link
Contributor

The following gets flagged by the no-semi rule:

enum class Test {
  ;

  val test = ordinal + 1
}

Also the ; is removed when using the auto format option; however then it is a compile error since the ; is required. So for enums that contain NO entries but variables or other statements the ; is required.

@paul-dingemans paul-dingemans added this to the 1.4.0 milestone Aug 20, 2024
@paul-dingemans
Copy link
Collaborator

Tnx for reporting. Out of interest, what is your use case for using an enum class without values?

@vanniktech
Copy link
Contributor Author

I store my Feature Flags in my enums. After a while I purge them when I've activated them and they are working fine. And it just happened to be that right now I don't have any Feature Flags but I want to keep my logic around them (computed properties).

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.

2 participants