Files
kotlin-fork/compiler/testData/codegen/box/specialBuiltins/removeSetInt.kt
T
Mads Ager 98ceee784a JVM_IR: More special bridge rewriting.
If there is an existing method that will have its argument types
remapped to boxed types, make sure to reflect that in the IR so
that code will be generated for a boxed value instead of a
primitive value.
2019-11-25 17:37:57 +03:00

22 lines
420 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// KJS_WITH_FULL_RUNTIME
// IGNORE_BACKEND: NATIVE
class MySet : HashSet<Int>() {
override fun remove(element: Int): Boolean {
return super.remove(element)
}
}
fun box(): String {
val a = MySet()
a.add(1)
a.add(2)
a.add(3)
if (!a.remove(1)) return "fail 1"
if (a.remove(1)) return "fail 2"
if (a.contains(1)) return "fail 3"
return "OK"
}