afterEvaluate {
kotlin {
targets.all {
compilations.all {
// can't use compilations.test because not all "compilations" have a test variant
if (name == 'test') {
kotlinOptions {
freeCompilerArgs = ['-Xuse-experimental=kotlin.Experimental']
}
}
}
}
}
}
i think i had to do it this way for the reason noted in the comments