JS: add test to prove that KT-14419 is not more reproducible. Add test to prove that extension delegate with extension getValue is translated correctly.
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
open class C
|
||||
|
||||
object O : C()
|
||||
|
||||
object K : C()
|
||||
|
||||
class D(val value: String) {
|
||||
operator fun getValue(thisRef: C, property: Any): String = value
|
||||
}
|
||||
|
||||
val O.prop by D("O")
|
||||
val K.prop by D("K")
|
||||
|
||||
fun box() = O.prop + K.prop
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
class A(val o: String)
|
||||
|
||||
interface I {
|
||||
val k: String
|
||||
}
|
||||
|
||||
inline operator fun A.getValue(thisRef: I, property: Any): String = o + thisRef.k
|
||||
|
||||
class B(override val k: String) : I
|
||||
|
||||
val B.prop by A("O")
|
||||
|
||||
fun box() = B("K").prop
|
||||
Reference in New Issue
Block a user