mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
Two KParameter instances are equal iff their backing descriptors are equal and their callables are equal
29 lines
554 B
Kotlin
Vendored
29 lines
554 B
Kotlin
Vendored
import kotlin.test.*
|
|
|
|
fun Int.foo(s: String) {}
|
|
|
|
class A {
|
|
fun bar() {}
|
|
}
|
|
|
|
fun baz(name: String) {}
|
|
|
|
fun box(): String {
|
|
assertEquals(
|
|
listOf("extension receiver of ${Int::foo}", "parameter #1 s of ${Int::foo}"),
|
|
Int::foo.parameters.map(Any::toString)
|
|
)
|
|
|
|
assertEquals(
|
|
listOf("instance of ${A::bar}"),
|
|
A::bar.parameters.map(Any::toString)
|
|
)
|
|
|
|
assertEquals(
|
|
listOf("parameter #0 name of ${::baz}"),
|
|
::baz.parameters.map(Any::toString)
|
|
)
|
|
|
|
return "OK"
|
|
}
|