From 09fb2cd7469f8ec8768131ce9fa5ed020b3a94af Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Tue, 9 Mar 2021 13:18:45 +0100 Subject: [PATCH] [minor] disable implicits test on IR, see added comments for details --- .../test/ImplicitsFromScriptResultTest.kt | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/libraries/scripting/jvm-host-test/test/kotlin/script/experimental/jvmhost/test/ImplicitsFromScriptResultTest.kt b/libraries/scripting/jvm-host-test/test/kotlin/script/experimental/jvmhost/test/ImplicitsFromScriptResultTest.kt index 5c0de0ad94c..539f63b5d11 100644 --- a/libraries/scripting/jvm-host-test/test/kotlin/script/experimental/jvmhost/test/ImplicitsFromScriptResultTest.kt +++ b/libraries/scripting/jvm-host-test/test/kotlin/script/experimental/jvmhost/test/ImplicitsFromScriptResultTest.kt @@ -35,16 +35,21 @@ import kotlin.script.experimental.jvmhost.JvmScriptCompiler */ class ImplicitsFromScriptResultTest : TestCase() { fun testImplicits() { - val host = CompilerHost() + if (System.getProperty("kotlin.script.base.compiler.arguments")?.contains("-Xuse-ir") != true) { + // the implementation of the Compiler Host doesn't work with IR - the inter-script symbol table + // should be maintained to make it run (see latest REPL compiler implementations for details + // TODO: consider either fix it or rewrite to the REPL compiler + val host = CompilerHost() - val snippets = listOf( - "val xyz0 = 42", - "fun f() = xyz0", - "val finalRes = xyz0 + f()", - ) - for (snippet in snippets) { - val res = host.compile(snippet) - assertTrue(res is ResultWithDiagnostics.Success) + val snippets = listOf( + "val xyz0 = 42", + "fun f() = xyz0", + "val finalRes = xyz0 + f()", + ) + for (snippet in snippets) { + val res = host.compile(snippet) + assertTrue(res is ResultWithDiagnostics.Success) + } } } }