Fix issue #KT-24475

* count coroutine metadata references during RemoveUnusedImport pass in JsInliner
* add cases to test usage of stdlib symbols in inlined functions
This commit is contained in:
Roman Artemev
2018-07-17 19:26:05 +03:00
committed by Roman Artemev
parent 75c7045ea7
commit 14b1f0ef6a
12 changed files with 149 additions and 6 deletions
@@ -0,0 +1,28 @@
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1117
// MODULE: lib
// FILE: lib.kt
inline fun foo(i1: Int, i2: Double): Int {
val o = object : Comparable<Int> {
override fun compareTo(other: Int) = i1-other
}
return o.compareTo(i2.toInt())
}
// MODULE: main(lib)
// FILE: main.kt
fun bar(i: Int):Int {
class Cmp2() : Comparable<Int> {
override fun compareTo(other: Int) = -other
}
return Cmp2().compareTo(i)
}
fun box():String {
if (foo(10, 20.0) + bar(-10) != 0) return "FAIL"
return "OK"
}