Inspectopedia 2026.1 Help

Position-based destructuring should use positional syntax

Reports position-based destructuring declarations that use custom componentN functions and need to be migrated for name-based destructuring.

With new name-based destructuring enabled, parentheses (x, y) will be used for name-based destructuring, while square brackets [x, y] should be used for position-based destructuring.

The inspection warns when:

  • Destructuring a non-data-class (all components are custom)

  • Destructuring a data class with more entries than primary constructor parameters (extra components are custom)

Examples:

val (x, y) = listOf(1, 2) // warning: uses custom componentN for ((key, value) in mapOf(1 to "one")) { } // warning: uses custom componentN data class Person(val name: String, val age: Int) { operator fun component3(): String = name + age } val (name, age, rendered) = Person("John", 30) // warning: component3 is custom

This inspection is part of the migration plan for name-based destructuring.

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

CustomComponentDestructuringMigration
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | Kotlin | Code migration

Inspection ID: CustomComponentDestructuringMigration

Suppressing Inspection

You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:

//noinspection CustomComponentDestructuringMigration

More detailed instructions as well as other ways and options that you have can be found in the product documentation:

Inspection Details

By default bundled with:

IntelliJ IDEA 2026.1, Qodana for JVM 2026.1,

Last modified: 31 March 2026