``` open class dmap( val map : Map< String, Any...
# announcements
g
Copy code
open class dmap( val map : Map< String, Any > )

inline fun <T : dmap, reified TValue : dmap> T.dmap(): ReadOnlyProperty<T, TValue> {
    return object : ReadOnlyProperty<T, TValue> {
        override fun getValue(thisRef: T, property: KProperty<*>) = TValue( thisRef.map[property.name] ) )
    }
}
p
I don't think this is possible in Kotlin, unless you want to use reflection.