Enforce spacing around double colons
このページは日本語には対応しておりません。随時翻訳に取り組んでいます。
翻訳に関してご質問やご意見ございましたら、
お気軽にご連絡ください。
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
Seamless integrations. Try Datadog Code Security