certainly caught me out before, do you think regis...
# koin
a
certainly caught me out before, do you think registration of generics could be made illegal?
a
sorry don’t understand 😕
a
Suggestion: when attempting to register a generic type, it triggers a runtime exception. Unless they have opted in to allow generics.
a
you mean, by trying t ooverride a type that already exists .... because declared a generic type?
a
example:
Copy code
single {
   emptyList<Int>()
}
Would fail at runtime.
because
List<Int>
is generic.
Nothing to do with overriding.
a
it won’t fail if you request it with a name:
Copy code
single("myList") {
   emptyList<Int>()
}
get<List<Int>>(name = "myList")
a
Are you saying it does fail if I don't provide a name?
I'm stuck on 0.9.3 so I can't check!
a
won’t fail if you provide only one definition. But several list will have the same underlying type. That’s why we have to give a name.
stuck on 0.9.3? Why can’t upgrade?
a
I wrote custom code to bridge to Java, and that doesn't work in later versions
so now I'm waiting for dagger to be gone, then I won't need the custom code
but right now we're stuck
a
404
😕
a
The JavaKoinComponent class could help you perhaps
a
thanks!