[JS IR] Use type upper bounds for calculating function signatures

^KT-59239 Fixed
This commit is contained in:
Alexander Korepanov
2023-06-12 13:41:15 +02:00
committed by Space Team
parent a4d40498c7
commit fc898c7620
20 changed files with 163 additions and 26 deletions
@@ -0,0 +1,18 @@
// DONT_TARGET_EXACT_BACKEND: JS
// WITH_STDLIB
class MySet<K, V, E : Map.Entry<K, V>>: AbstractSet<E>() {
override fun contains(element: E): Boolean { return element.key !== null }
override val size: Int get() = 0
override fun isEmpty(): Boolean = false
override fun containsAll(elements: Collection<E>): Boolean = false
override fun iterator(): Iterator<E> = TODO("")
}
fun box(): String {
val h = MySet<Int, Int, Map.Entry<Int, Int>>()
val c = (object {}).let { h.contains(it as Any?) }
return if (c) "NOT OK" else "OK"
}