Dias
10/31/2018, 12:00 PMbind(object : TypeLiteral<KafkaConsumer<String, QuoteServed>>() {}).toProvider(object : TypeLiteral<KafkaConsumerFactory<QuoteServed>>() {})
bind(object : TypeLiteral<EventConsumer<QuoteServed>>() {}).to(object : TypeLiteral<KafkaEventConsumer<QuoteServed>>() {})
to this: bindSpecial<QuoteServed>()
private inline fun <reified T: SpecificRecord> bindSpecial(){
bind(object : TypeLiteral<KafkaConsumer<String, T>>() {}).toProvider(object : TypeLiteral<KafkaConsumerFactory<T>>() {})
bind(object : TypeLiteral<EventConsumer<T>>() {}).to(object : TypeLiteral<KafkaEventConsumer<T>>() {})
}
but it fails with org.apache.kafka.clients.consumer.KafkaConsumer<java.lang.String, T> cannot be used as a key; It is not fully specified.
.
I probably misunderstand how the inlining works, but I thought the inlined function will be just copied with Generics substituted with actual type