Support references to extension properties in JVM codegen
#KT-1183 In Progress
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
var storage = 0
|
||||
|
||||
var Int.foo: Int
|
||||
get() {
|
||||
return this + storage
|
||||
}
|
||||
set(value) {
|
||||
storage = this + value
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val pr = Int::foo
|
||||
if (pr.get(42) != 42) return "Fail 1: ${pr[42]}"
|
||||
pr.set(200, 39)
|
||||
if (pr.get(-239) != 0) return "Fail 2: ${pr[-239]}"
|
||||
if (storage != 239) return "Fail 3: $storage"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user