Smorg
12/24/2018, 4:49 AMShawn
12/24/2018, 4:50 AMget()
private val _foo = Foo()
val OtherType.foo: Foo
get() = _foo
Smorg
12/24/2018, 4:55 AMShawn
12/24/2018, 4:56 AMserebit
12/24/2018, 4:57 AMMutableMap
with the class instance as the key and the property as the valueShawn
12/24/2018, 4:58 AMMap
rather than a MutableMap
Smorg
12/24/2018, 5:06 AMserebit
12/24/2018, 6:49 PMprivate val map = mutableMapOf<Int>().withDefault { 0 }
val Foo.bar get() = map[this]
Shawn
12/24/2018, 6:52 PMmap
is private within Foo
serebit
12/24/2018, 6:53 PM