restioson
06/21/2017, 4:23 PMsuspend fun <T: Event> waitEvent(event: EventDescriptor<T>): T = suspendCoroutine {
if (waiters.containsKey(it)) {
waiters[it]?.add(event as EventDescriptor<Event>) // LINE
}
Hi guys, I'm not understanding why exactly I am getting an unchecked cast on the highlighted line. event is type EventDescriptor<T>, and T: Event, so shouldn't event be castable to EventDescriptor<Event>?