Inspectopedia Help

Existing backing field without assignment

Reports property setters that don't update the backing field.

The quick-fix adds an assignment to the backing field.

Example:

class Test { var foo: Int = 1 set(value) { } }

After the quick-fix is applied:

class Test { var foo: Int = 1 set(value) { field = value } }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Kotlin, @snapshot@

Last modified: 13 July 2023