I want to use the Result class which is described here:
But when I try to use it as a return value of a function, I got 'kotlin.Result' cannot be used as a return type
message.
In other Kotlin/JVM projects, I can easily add the below lines to build.gradle.kts and it works fine.
tasks {
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs =
freeCompilerArgs + "-Xallow-result-return-type" + "-Xinline-classes"
}
}
Thank you.