Back to Intellij Community

SuspiciousCallableReferenceInLambda

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

2025.3-rc-2398 B
Original Source

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:

val numbers = listOf(1, 2, 3)
  val result = numbers.map { it::toString }

After the quick-fix is applied:

val numbers = listOf(1, 2, 3)
  val result = numbers.map(Int::toString) // real type here