-
-
Notifications
You must be signed in to change notification settings - Fork 778
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
UnnecessaryAbstractClass false positive for abstractproperties #2526
Comments
🤔 |
This is a bug. Thanks for reporting this. |
An abstract class with concrete members derived from a base class is not reported by this rule, since there are actually concrete members created in the inheritance tree. Closes #2526
Why does Detekt report this ParentClass as an UnnecessaryAbstractClass ? abstract class ParentClass {
abstract val type: String
}
data class ChildOne(val prop1: Int) {
override val type = "ChildOne"
}
data class ChildTwo(val prop2: Double) {
override val type = "ChildTwo"
} Edit: just improve formatting. |
I think that the rule tells that it could be replaced by an interface and that's true and the reason yout code is reported: interface ParentClass {
val type: String
} |
Expected Behavior
UnnecessaryAbstractClass
should allow an abstract class with abstract propertiesObserved Behavior
UnnecessaryAbstractClass
fails on an abstract class with abstract propertiesSteps to Reproduce
UnnecessaryAbstractClass
fails onBaseTransferWidgetViewModel
. It allowed it in detekt 1.7.0Your Environment
The text was updated successfully, but these errors were encountered: