https://kotlinlang.org logo
#detekt
Title
# detekt
p

Peter

09/07/2023, 7:35 AM
Is it okay, that Detekt flags this kind of code, with failed
MatchingDeclarationName
? 🤔
Copy code
// file name Banana.kt
enum Color {
    A,
    B
}

fun Banana(onClick: (Color) -> Unit) = TODO("")
s

Sebastian Schuberth

09/07/2023, 7:54 AM
Yes, as that rule applies to an object, class, enum or interface, but not to a function.
You should be able to move the enum class to below the function to work around that.
2 Views