报告具有隐式返回类型的 public
和 protected
函数和属性。
出于 API 稳定性的原因,建议显式指定这样的类型。
示例:
fun publicFunctionWhichAbusesTypeInference() =
otherFunctionWithNotObviousReturnType() ?: yetAnotherFunctionWithNotObviousReturnType()
在应用快速修复后:
fun publicFunctionWhichAbusesTypeInference(): Api =
otherFunctionWithNotObviousReturnType() ?: yetAnotherFunctionWithNotObviousReturnType()