mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
20 lines
288 B
Kotlin
Vendored
20 lines
288 B
Kotlin
Vendored
class Test {
|
|
var storage = "Fail"
|
|
|
|
var Int.foo: String
|
|
get() = storage
|
|
set(value) {
|
|
storage = value
|
|
}
|
|
|
|
fun test(): String {
|
|
val i = 1
|
|
i.foo = "OK"
|
|
return i.foo
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
return Test().test()
|
|
}
|