https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
e

Edoardo Luppi

11/24/2023, 9:36 AM
Is it only me or the warning for beta expect/actual classes won't ever go away, no matter which flag I set. IDEA 2023.3 EAP (latest) and 1.9.21
m

Mario Loncar

11/24/2023, 12:00 PM
Copy code
tasks.withType<KotlinCompilationTask<*>>().configureEach {
    compilerOptions {
        freeCompilerArgs.add("-Xexpect-actual-classes")
    }
}
I have this in
shared:build.gradle
and warning is gone
j

Jeff Lockhart

11/24/2023, 4:19 PM
This is the way I had to do it in 1.9.20, based on this thread. Kotlin 1.9.21 introduced a language feature option to address this issue with the IDE not picking up the compiler flag.
t

tapchicoma

11/26/2023, 9:31 PM
1.9.21 has partially returned compiler options DSL in extension, so following should work:
Copy code
kotlin {
    compilerOptions {
        freeCompilerArgs.add("-Xexpect-actual-classes")
    }
}
e

Edoardo Luppi

12/02/2023, 1:00 PM
Thanks @tapchicoma, this looks a lot cleaner.
2 Views