Is there any way that I can force compiler, IDE or any tool like detekt, klint to give error/warning when a method explicitly not defines the return type ?
Copy code
fun exampleMethod() = "SomeString" // want to have warning/error
fun exampleMethod(): String = "SomeString" // this should pass
c
Chris Lee
12/03/2022, 4:42 PM
you can enable the Kotlin public API mode, requiring an explicit return value on publicly exposed methods.
m
Mustafa Ozhan
12/03/2022, 4:43 PM
Ohh this looks promising let me have a look at it 🙂 Thanks a lot!