K2: add reproducer for KT-54275

This commit is contained in:
Mikhail Glukhikh
2022-10-07 11:18:41 +02:00
committed by Space Team
parent 7f6bd2ab1e
commit d491eba629
5 changed files with 66 additions and 0 deletions
@@ -0,0 +1,17 @@
typealias EventHandler<E> = (e: E) -> Unit
class EventListener<E: Event>() {
companion object {
inline operator fun <reified E: Event> invoke(
noinline callback: EventHandler<E>,
): EventListener<E> = TODO()
}
}
inline fun <reified E: Event> EventHandler<E>.withPriority() = EventListener(this)
inline fun <reified E: Event> EventHandler<E>.withDefaultPriority() = withPriority()
abstract class Event