Skip to content

Instantly share code, notes, and snippets.

@jakobkmar
Last active October 11, 2022 05:17
Show Gist options
  • Save jakobkmar/5068aa14e37b859c3246de91cac74347 to your computer and use it in GitHub Desktop.
Save jakobkmar/5068aa14e37b859c3246de91cac74347 to your computer and use it in GitHub Desktop.

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".

image

Now add -Xskip-prerelease-check to the compiler arguments here.

image

Remember that you have done this, to remove it at some point in the future where this is no longer necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment