Named Boolean Argument (ARCH8185)
Ce contenu n’est pas encore disponible dans votre langue.
Key kotlin.quality.named-boolean-argument · Severity info · Category quality
Flags true / false literals passed positionally to calls with two or more arguments - the reader cannot tell what the flag means. Only where a name can be added: Kotlin does not allow named arguments for functions declared in Java.
Incorrect
Section titled “Incorrect”render(user, true, false)Correct
Section titled “Correct”render(user, compact = true, showAvatar = false)Use named arguments for boolean flags, or an enum.