Function or property has platform type
Reports functions and properties that have a platform type.
To prevent unexpected errors, the type should be declared explicitly.
Example:
fun foo() = java.lang.String.valueOf(1)
The quick fix allows you to specify the return type:
fun foo(): String = java.lang.String.valueOf(1)
Inspection options
Option | Type | Default |
---|---|---|
Apply only to public or protected members | Checkbox | true |
Report for types with platform arguments | Checkbox | false |
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for JVM 2023.3 |
Plugin: | Kotlin, @snapshot@ |
Last modified: 13 July 2023