Back to Intellij Community

SelfReferenceConstructorParameter

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

2025.3-rc-2294 B
Original Source

Reports constructors with a non-null self-reference parameter.

Such constructors never instantiate a class.

The quick-fix converts the parameter type to nullable.

Example:

class SelfRef(val ref: SelfRef)

After the quick-fix is applied:

class SelfRef(val ref: SelfRef?)