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/nullable-type-spacing

Language: Kotlin

Severity: Notice

Category: Code Style

Description

A type can be declared as nullable by appending a question mark (?) to the type name. The proper coding convention is to have no space between the type name and the question mark. This rule ensures that there is no space between the type and the question mark.

Non-Compliant Code Examples

val foo: String ? = null
val foo: List<String ?> = listOf(null)

Compliant Code Examples

val foo: String? = null
val foo: List<String?> = listOf(null)
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