报告检查已声明变量非 null 值的 assert 调用。

Using !! or ?: makes your code simpler.

The quick-fix replaces assert with !! or ?: operator in the variable initializer.

示例:


  fun foo(p: Array<String?>) {
      val v = p[0]
      assert(v != null, { "Should be not null" })
  }

在应用快速修复后:


  fun foo(p: Array<String?>) {
      val v = p[0] ?: error("Should be not null")
  }