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

MethodOverloading false positive if every entry of an enum implement a method. #2216

Closed
jaychang0917 opened this issue Dec 31, 2019 · 1 comment · Fixed by #2221
Closed
Milestone

Comments

@jaychang0917
Copy link

jaychang0917 commented Dec 31, 2019

Expected Behavior

Should not treat enum instance implementation as method overloading.

Observed Behavior

when every entry of an enum implement a method, it is treated as method overloading.

Steps to Reproduce

enum class MethodOverloading {
    FOO1 {
        override fun foo() = 1
    },
    FOO2 {
        override fun foo() = 2
    },
    FOO3 {
        override fun foo() = 3
    },
    FOO4 {
        override fun foo() = 4
    },
    FOO5 {
        override fun foo() = 5
    },
    FOO6 {
        override fun foo() = 6
    },
    FOO7 {
        override fun foo() = 7
    };

    abstract fun foo(): Int
}

Your Environment

  • Version of detekt used: 1.3.0
  • Version of Gradle used (if applicable): 5.4.1

Thanks!

@schalkms
Copy link
Member

schalkms commented Jan 2, 2020

Thanks for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants