Scripting: fix script type extraction on psi2ir

#KT-48812 fixed
This commit is contained in:
Ilya Chernikov
2022-04-26 12:03:40 +02:00
committed by teamcity
parent 3e19e9d190
commit a78d063bef
3 changed files with 29 additions and 0 deletions
@@ -223,6 +223,12 @@ class MainKtsTest {
assertEquals("success", value)
}
@Test
fun testKt48812() {
val res = evalFile(File("$TEST_DATA_ROOT/kt48812.main.kts"))
assertSucceeded(res)
}
private fun assertSucceeded(res: ResultWithDiagnostics<EvaluationResult>) {
Assert.assertTrue(
"test failed:\n ${res.reports.joinToString("\n ") { it.message + if (it.exception == null) "" else ": ${it.exception}" }}",
@@ -0,0 +1,11 @@
@file:DependsOn("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.runBlocking
fun printInt(n : Int) = println(n)
runBlocking {
flowOf(1, 2, 3)
.onEach(::printInt)
.collect()
}