Hi all. Does Koin support generic types? Like so: ...
# koin
a
Hi all. Does Koin support generic types? Like so:
Copy code
single<IInMemoryDB<City>> { InMemoryDBImpl() }
single<IInMemoryDB<Country>> { InMemoryDBImpl() }
It appears to me that one instance of
IInMemoryDB
is being injected and the generic type information is being erased. Thoughts?
1
Is it a Kotlin thing? No way around it other than doing this right?:
Copy code
class InMemoryCityDb : InMemoryDBImpl<City>()
class InMemoryCountryDb : InMemoryDBImpl<Country>()


single<InMemoryCityDb> { InMemoryCityDb() }
single<InMemoryCountryDb> { InMemoryCountryDb() }
a
Thank you @curioustechizen