报告非 null 接收器上仅对可 null 接收器有意义的调用。

只有在可 null 类型的接收器上调用时,标准库中 orEmpty()isNullOrEmpty 之类的几个函数才有意义。 在其他情况下,可以忽略它们,因为结果将相同。

Remove redundant call and Change call to … quick-fixes can be used to amend the code automatically.

示例:


  fun test(s: String) {
      val x = s.orEmpty() // 快速修复会简化为 's'
      val y = s.isNullOrEmpty() // 快速修复会简化为 's.isEmpty()'
  }