How to use Silk 1.9.1
To use Silk 1.9.1 with Kotlin 1.7.0 or 1.7.10, you have to do the following steps, since Silk already requires context receivers to function.
1. Add the compiler argument to Gradle
tasks {
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs += "-Xskip-prerelease-check"
}
}
}
If you want to use context receivers yourself, add -Xcontext-receivers
to the list here as well.
2. Add the compiler argument to IntelliJ
You have to set -Xskip-prerelease-check
here as well, since the compiler of the Kotlin IntelliJ Plugin is a separate thing.
Press Ctrl + Shift + A to open the actions search and search for "kotlin compiler".
Now add -Xskip-prerelease-check
to the compiler arguments here.
Remember that you have done this, to remove it at some point in the future where this is no longer necessary.