报告内联 lambda 内未标记的 return 表达式。

此类表达式可能令人困惑,因为可能不清楚哪个范围属于 return

Change to return@… quick-fix can be used to amend the code automatically.

示例:


  fun test(list: List<Int>) {
      list.forEach {
          // 此返回表达式从函数测试返回
          // 可以将其更改为 return@forEach 以更改范围
          if (it == 10) return
      }
  }

在应用快速修复后:


  fun test(list: List<Int>) {
      list.forEach {
          if (it == 10) return@test
      }
  }