tseisel
03/17/2019, 1:17 PMList<E>
to List<Foo>
(or List<Bar>
) in the code below ?Andreas Sinz
03/17/2019, 1:26 PMinline fun <reified E : Any> update(updated: List<E>) = when(E::class) {
Foo::class -> sendUpdate(aFoo, updated) // Error: expecting List<Foo>, found List<E>
Bar::class -> sendUpdate(aBar, updated) // Error: expecting List<Bar>, found List<E>
else -> error("Unknown type: ${E::class.simpleName}")
}