https://kotlinlang.org logo
#codingconventions
Title
# codingconventions
k

Klitos Kyriacou

08/10/2022, 10:36 AM
I wrote a function that returns a
kotlin.Result
. The project I'm working on currently uses Kotlin 1.6.21, and IDEA 2022.1 tells me "Function returning Result with a name that does not end with Catching". Is this a recommended coding convention? What is the disadvantage of not ending in "Catching"? Also, when I click on "Show inspection description", it says "Result should never be used as a return type." I know that was the case in an old version of Kotlin, when the Result type was first introduced, but I thought that was now changed and that we can now return Result. Is this something that should be changed in IDEA?
g

George

08/22/2022, 4:39 PM
Per result-keep after kotlin 1.5 you should be able to use it. Maybe worth to open a ticket
k

Klitos Kyriacou

08/22/2022, 4:59 PM
Thanks, George, I've created IDEA-300447.
8 Views