hey guys, i have to definitions in my module: ```f...
# koin
d
hey guys, i have to definitions in my module:
Copy code
factory<() -> User>
Copy code
factory<() -> Location>
koin treat it as same type and failed with this exception:
Copy code
org.koin.core.error.DefinitionOverrideException: Definition '[Factory:'kotlin.jvm.functions.Function0']' try to override existing definition. Please use override option to fix it
are there any workarounds?
f
No workarounds except named qualifiers, yes. Kotlin lambdas get converted to Function0<T>, Function1<T, Y>, etc. and all these get hit by type erasure.
👍 1
j
Maybe you can avoid qualifier with
fun interface
but I don't like losing the type in hints