From cf9b2e6377c0c500b7fbda7b12dc245e36863802 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Wed, 7 Nov 2018 18:18:02 +0300 Subject: [PATCH] Fix potential CCE in LightCodeInsight tests in non-JVM --- .../kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) {