Has anyone tried using multibindings with a kotlin...
# dagger
m
Has anyone tried using multibindings with a kotlin function return type? Something as simple as this generates a compile error:
Copy code
interface SomeType
class Type1: SomeType
class MyFactory

@Module
@ContributesTo(MyLibraryScope::class)
class SomeTypeModule {
    @Provides
    @IntoMap
    @ClassKey(Type1::class)
    fun type1Factory(): () -> SomeType = { Type1() }

    @Provides
    fun x(
        factories: Map<Class<*>, () -> SomeType>
    ): MyFactory = MyFactory()
}
Copy code
error: [Dagger/MissingBinding] java.util.Map<java.lang.Class<?>,? extends kotlin.jvm.functions.Function0<? extends com.xfinity.dh.feature.library.di.SomeType>> cannot be provided without an @Provides-annotated method.