yeah, generic types are not handled. Prefer go wit...
# koin
a
yeah, generic types are not handled. Prefer go with some holder type instead
b
Mmmh, will be handled ? U mean using the IMPL instead of my contracts ?
a
yep in a first time approach
👍 1
b
Ok, that was our workaround, any plan to add generics support?
a
as it, generics can’t be supported as not forwarded by Kotlin reified types
But
you can use naming instead
retrieve component by name, it should be ok
b
Like in my examples ? I tried, didn’t work either
a
Copy code
val koin = koinApplication {
            logger(Level.DEBUG)
            modules(
                    module {
                        single("strings") { listOf("a string") }
                        single("ints") { listOf(42) }
                    }
            )
        }.koin

        val aString = koin.get<List<String>>("strings")
        assertEquals("a string", aString[0])

        val anInt = koin.get<List<Int>>("ints")
        assertEquals(42, anInt[0])
you can use the startKoin instead as start
but retrieve components instance by its name
b
yep, ur example looks like mine, I use the
Copy code
get(name = "onClickMapper")
but same error
here a complete example (with my module, which is in another file) :
Copy code
val cmsDataSourceModule = module {        single<BaseCmsMapper<SeasonHodor, Season>>(name = "seasonMapper") {
 SeasonMapper(errorDispatcher = get(), onClickMapper = get("onClickMapper")) }
}
My onClickMapper is created in another module (but still call in my Application file)