Back to Intellij Community

SimplifiableFlowCall

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

2025.3-rc-2403 B
Original Source

Reports function calls on the Flow type which could be replaced by simplified one.

Using corresponding functions makes your code simpler.

The quick-fix replaces the function calls with another one.

Example:

fun test(flow: Flow<Any>) {
      flow.filter { it is String }
  }

After the quick-fix is applied:

fun test(flow: Flow<Any>) {
      flow.filterIsInstance<String>()
  }