This page is not yet available in Spanish. We are working on its translation.
If you have any questions or feedback about our current translation project, feel free to reach out to us!

Metadata

ID: kotlin-code-style/extension-function-spacing

Language: Kotlin

Severity: Notice

Category: Code Style

Description

To keep code consistently styled, ensure there are no superfluous spaces in extension function declarations.

Non-Compliant Code Examples

fun <T>  List<T>.printAll() {}
fun <T> List <T>.printAll() {}
fun <T> List<T> .printAll() {}
fun <T> List<T>. printAll() {}

fun String ?.printAll() {}

fun String? .printAll() {}
fun String?. printAll() {}

fun Foo .Bar.printAll() {}
fun Foo. Bar.printAll() {}
fun Foo.Bar .printAll() {}
fun Foo.Bar. printAll() {}

fun Foo.Bar.printAll () {}
fun Foo.Bar.printAll (

) {}

Compliant Code Examples

fun <T> List<T>.printAll() {}

fun String?.printAll() {}

fun Foo.Bar.printAll() {}

fun Foo.Bar.printAll(

) {}
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Integraciones sin problemas. Prueba Datadog Code Security

PREVIEWING: guillaume.barrier/ERRORT-5095-general-doc-update