Files
kotlin-fork/compiler/testData/codegen/box/reflection/methodsFromAny/builtinFunctionsToString.kt
T
Mikhail Glukhikh c50aa5f2ec [FIR TEST] Bad test data changes due to Java signature transformation
Both changes are related to getOrDefault. We should either make Java
version low priority or remove it at all.
2020-10-23 08:12:16 +03:00

28 lines
886 B
Kotlin
Vendored

// SKIP_JDK6
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// FULL_JDK
// WITH_REFLECT
import kotlin.test.assertEquals
import java.util.*
fun assertToString(s: String, x: Any) {
assertEquals(s, x.toString())
}
fun box(): String {
assertToString("fun kotlin.collections.Map<K, V>.getOrDefault(K, V): V", Map<*, *>::getOrDefault)
assertToString("fun java.util.HashMap<K, V>.getOrDefault(K, V): V", HashMap<*, *>::getOrDefault)
// TODO: uncomment once KT-11754 is fixed
// assertToString("", MutableList<*>::removeAt)
assertToString("fun kotlin.collections.Collection<E>.contains(E): kotlin.Boolean", Collection<*>::contains)
assertToString("fun kotlin.collections.Set<E>.contains(E): kotlin.Boolean", Set<*>::contains)
assertToString("fun kotlin.collections.Collection<E>.isEmpty(): kotlin.Boolean", Collection<*>::isEmpty)
return "OK"
}