I’m trying to have a multibinding of lambdas (e.g....
# kotlin-inject
f
I’m trying to have a multibinding of lambdas (e.g.
() -> Unit
) and it doesn’t seem to work, is this by design or would it make sense to file an issue? something like this for instance:
Copy code
@Component
abstract class MyComponent {
  @Provides @IntoSet
  fun provides1(): () -> Unit = {}

  @Provides @IntoSet
  fun provides2(): () -> Unit = {}

  abstract val mySet: Set<() -> Unit>
}
gives me:
[ksp] Cannot find an @Inject constructor or provider for: Set<kotlin.Function0<kotlin.Unit>>
I tried working around it with a typealias but it doesn’t help, but maybe once this is fixed the typealias workaround would work? my current actual workaround is to wrap the lambda in another type (e.g.
class Wrapper(val value: () -> Unit)
)
e
I don't see why not, can you file an issue?
f