https://kotlinlang.org logo
Title
a

ahulyk

10/19/2018, 7:59 AM
Hi) I'm trying to test New Type Inference! But I can not configure it( I use gradle kotlin DSL with plugin: kotlin("gradle-plugin", "1.3.0-rc-190") and kotlin version kotlin("stdlib-jdk7", "1.3.0-rc-190") I can not enable newInference in gradle DSL:
kotlin {
    experimental {
        newInference = "enable" //this does not compile
    }
}
because ExperimentalExtension is missing newInference variable
org.jetbrains.kotlin.gradle.dsl.ExperimentalExtension:
open class ExperimentalExtension {
    var coroutines: Coroutines? = null
}
h

hho

10/19/2018, 8:10 AM
Please put code snippets in triple backticks `
j

jw

10/19/2018, 12:45 PM
This flag hasn't landed in the compiler yet. You have to use the old
-X
flags for now. I forget the names which enable the new inference. There's two of them...
a

ahulyk

10/19/2018, 1:29 PM
@jw thanks - got it 🙂
@jw can confirm that
afterEvaluate {
    tasks.withType(KotlinCompile::class)
        .forEach {
            it.kotlinOptions { freeCompilerArgs = listOf("-Xnew-inference") }
        }
}
fix the issue 🙂