Inspectopedia Help

Suspicious callable reference used as lambda result

Reports lambda expressions with one callable reference.

It is a common error to replace a lambda with a callable reference without changing curly braces to parentheses.

Example:

listOf(1,2,3).map { it::toString }

After the quick-fix is applied:

listOf(1,2,3).map(Int::toString)

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Kotlin, @snapshot@

Last modified: 13 July 2023