JS: cache PropertyMetadata objects in property delegates

Also, remove unused PropertyMetadata instances

See KT-20737, KT-20738
This commit is contained in:
Alexey Andreev
2017-10-17 17:36:38 +03:00
parent 7ebfba3722
commit 88441da131
8 changed files with 96 additions and 4 deletions
@@ -0,0 +1,12 @@
// EXPECTED_REACHABLE_NODES: 1131
// PROPERTY_NOT_USED: PropertyMetadata
import kotlin.reflect.KProperty
class MyDelegate(val value: String) {
inline operator fun getValue(receiver: Any?, property: KProperty<*>): String = value
}
fun box(): String {
val x by MyDelegate("OK")
return x
}