arild
01/22/2019, 4:19 PMinterface A {
fun getInt(): Int
}
interface B {
fun getString(): String
}
fun <Union> kotlinTypeUnion(param: Union) where Union: A, Union: B {
val fromA: Int = param.getInt()
val fromB: String = param.getString()
}
kotlinTypeUnion(object: A, B {
override fun getInt() = 1
override fun getString() = "two"
})
any thoughts?