Back to Intellij Community

ConvertNameBasedDestructuringShortFormToFull

plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/ConvertNameBasedDestructuringShortFormToFull.html

2025.3-rc-2449 B
Original Source

Reports destructuring declarations in short form and suggests converting them to the full form with explicit property names. Applies for data classes.

Example:

data class Person(val firstName: String, val lastName: String)
  val (first, lastName) = person

The quick-fix converts to full form destructuring:

(val first = firstName, val lastName) = person

This form makes the mapping between variables and properties explicit.