snowe
06/21/2018, 1:20 AMinline fun <reified C> commandHandler(handler: MessageHandler<CommandMessage<*>>) {
addCommandHandler(C::class.java, handler)
}
fun <C> addCommandHandler(payloadType: Class<C>, command: MessageHandler<CommandMessage<*>>) {
commandHandlers[payloadType] = command
}
but when attempting to using a function literal to automatically convert to the SAM, it fails. If I specify the type it succeeds.
commandHandler<CreateAggregateCommand>(MessageHandler {
invoked.set(true)
null
})
succeeds^