This product is not supported for your selected Datadog site. ().
Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.

Metadata

ID: kotlin-code-style/double-colon-spacing

Language: Kotlin

Severity: Notice

Category: Code Style

Description

In callable references, there should be no spaces separating the class, instance, method, or property from the double colons (::).

An expression like List::filter is correct, while List :: filter is not.

Non-Compliant Code Examples

val clz1 = Foo ::class
val clz2 = Foo:: class
val clz3 = Foo :: class

val filter1 = List ::filter
val filter2 = List:: filter
val filter3 = List :: filter

val constr = :: Regex

Compliant Code Examples

val filter = List::filter
val clz = Foo::class
val constr = ::Regex
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Security

PREVIEWING: heston/DOCS-10466