mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
Move from package "kotlin.reflect" to "kotlin.reflect.jvm.internal". They are internal detail of the compiler and should not be used directly (especially now that "kotlin.reflect" is in default import paths). Also rename "KFunctionImplN" to "KFunctionNImpl", because this name makes more sense
24 lines
598 B
Kotlin
24 lines
598 B
Kotlin
fun foo(s: String) {}
|
|
|
|
class A {
|
|
fun bar(): String = ""
|
|
}
|
|
|
|
fun A.baz() {}
|
|
|
|
|
|
fun box(): String {
|
|
val f = "${::foo}"
|
|
if (f != "kotlin.reflect.jvm.internal.KFunction1Impl<java.lang.String, kotlin.Unit>") return "Fail foo: $f"
|
|
|
|
val nameOfA = (A() as java.lang.Object).getClass().getName()
|
|
|
|
val g = "${A::bar}"
|
|
if (g != "kotlin.reflect.jvm.internal.KMemberFunction0Impl<$nameOfA, java.lang.String>") return "Fail bar: $g"
|
|
|
|
val h = "${A::baz}"
|
|
if (h != "kotlin.reflect.jvm.internal.KExtensionFunction0Impl<$nameOfA, kotlin.Unit>") return "Fail baz: $h"
|
|
|
|
return "OK"
|
|
}
|