Inspectopedia Help

Public API declaration with implicit return type

Reports public and protected functions and properties that have an implicit return type. For API stability reasons, it's recommended to specify such types explicitly.


fun publicFunctionWhichAbusesTypeInference() = otherFunctionWithNotObviousReturnType() ?: yetAnotherFunctionWithNotObviousReturnType()
fun publicFunctionWhichAbusesTypeInference(): Api = otherFunctionWithNotObviousReturnType() ?: yetAnotherFunctionWithNotObviousReturnType()

Inspection options

Here you can find the description of settings available for the Public API declaration with implicit return type inspection, and the reference of their default values.

Apply also to internal members

Not selected

Apply also to private members

Not selected

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Kotlin, 241.14841-IJ

Last modified: 12 March 2024