diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt index 7a0f6758b0a..2c7269c8382 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt @@ -220,7 +220,9 @@ fun configureCompilerOptions(fileText: String, project: Project, module: Module) val facetSettings = KotlinFacet.get(module)!!.configuration.settings if (jvmTarget != null) { - (facetSettings.compilerArguments as K2JVMCompilerArguments).jvmTarget = jvmTarget + val compilerArguments = facetSettings.compilerArguments + require(compilerArguments is K2JVMCompilerArguments) { "Attempt to specify `$JVM_TARGET_DIRECTIVE` for non-JVM test" } + compilerArguments.jvmTarget = jvmTarget } if (options != null) {