KT-2752: fix JsName with explicit use target. Add some tests for JsName with use targets
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A {
|
||||
@JsName("xx") val x: Int by B(23)
|
||||
|
||||
@get:JsName("getYY") val y: Int by B(42)
|
||||
}
|
||||
|
||||
class B(val value: Int) {
|
||||
operator fun getValue(thisRef: Any?, property: KProperty<*>): Int = value
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val a = A()
|
||||
assertEquals(23, a.x)
|
||||
assertEquals(42, a.y)
|
||||
|
||||
val d: dynamic = a
|
||||
assertEquals(23, d.xx)
|
||||
assertEquals(42, d.getYY())
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user