Is intelij supposed to understand the experimental...
# intellij
Is intelij supposed to understand the experimental command-line parameters? I added
Copy code
kotlinOptions.freeCompilerArgs += "-Xuse-experimental=kotlin.contracts.ExperimentalContracts"`
To my
, and
./gradlew build
compiles fine. Intelij still gives errors when actually trying to run code using contracts:
Copy code
Error:(552, 5) Kotlin: This declaration is experimental and its usage must be marked with '@kotlin.contracts.ExperimentalContracts' or '@UseExperimental(kotlin.contracts.ExperimentalContracts::class)'
Intelij seems to at least understand that it's a compiler argument, it automatically ends up in Project settings > Modules > main > Kotlin > Additional cmdline parameters. Is this just not supported right now or there another problem?
It should work. Failed to reproduce with a simple Gradle project (Kotlin 1.3.50 + IC-192.7142.36). By the format of the error message I see that you're building the project with internal IDEA build system, so the build is not delegated to Gradle in "File | Settings | Build, Execution, Deployment | Build Tools | Gradle". Is that on purpose? Anyway, failed to reproduce also with IDEA build after syncing the project with Gradle. Please file an issue at with a sample project to reproduce. Thanks!
I'll get started on a sample project, now that I know it's supposed to work. Yes it's intentionally build with IDEA, I know gradle works but now I wanted IDEA to work too.