https://kotlinlang.org logo
#koin
Title
t

taer

12/10/2020, 6:42 PM
If I have a class like this
Copy code
data class TopicDefinition<K, V> ...
that I want to create multiple singletons with but with different types for the K and V, I get an error that I can't have multiple singles
Copy code
org.koin.core.error.DefinitionOverrideException: Definition '[Single:'TopicDefinition']' try to override existing definition. Please use override option to fix it
Is there a way to have the generics part of the singleton that I'm missing? I know I can use named, but would prefer to let the types do the work if possible. Example, this fails unless I qualify with a name
Copy code
val controlTopicDef = get<TopicDefinition<Uuid.UUID, ControlEvent>>()