KT.HAS_PLATFORM_TYPE

Platform type is not declared explicitly in public API

Platform types must be declared explicitly in public APIs to prevent unexpected errors.

Noncompliant Code

Copy
class Person {
    fun apiCall() = System.getProperty("propertyName")
}

Compliant Code

Copy
class Person {
    fun apiCall(): String = System.getProperty("propertyName")
}

The content on this page is adapted from the Detekt Docs. Copyright ©2022 The Detekt Team. All rights reserved. https://detekt.dev/comments.html