someC: C, val someS: S)
val scope = MyScope(someC = "thisIsC", someS = "thisIsS")
val scopes: HashMap<String, Scope<*, *>> = hashMapOf()
inline fun <reified T> Any?.isType() = this is T
fun main() {
scopes["muScopeKey"] = scope
val result1 = scopes["muScopeKey"] is MyScope
val result2 = scopes["muScopeKey"].isType<MyScope>()
println("result2 $result2 ")
}
Вот как оно "работает" https://pl.kotl.in/Dn5nKf_OV
Обсуждают сегодня