Ali Albaali
02/05/2021, 6:53 PMkotlin.result
in commonMain source set? I tried all the solutions below(in the thread), and it still shows me the error. However it worked on the other targets.Ali Albaali
02/05/2021, 6:53 PMmetadata {
compilations.all {
kotlinOptions {
freeCompilerArgs = listOf("-Xallow-result-return-type", "-Xopt-in=kotlin.RequiresOptIn")
}
}
}
all {
languageSettings.apply {
useExperimentalAnnotation("kotlin.Experimental")
useExperimentalAnnotation("-Xallow-result-return-type")
enableLanguageFeature("AllowResultInReturnType")
enableLanguageFeature(LanguageFeature.AllowResultInReturnType.toString())
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xallow-result-return-type")
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions {
freeCompilerArgs = listOf("-Xallow-result-return-type")
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
useIR = true
jvmTarget = "11"
freeCompilerArgs = listOf("-Xallow-result-return-type")
}
}
targets.all {
compilations.all {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + "-Xallow-result-return-type"
}
}
}
Ali Albaali
02/05/2021, 7:22 PM