I have a component hierarchy that has an `expect` ...
# kotlin-inject
e
I have a component hierarchy that has an
expect
component in the middle of it, and the
actual
implementations provide platform specific bindings. That requires that all downstream components be generated for all platforms, even if they themselves are common, because common generated code wouldn't be able to see these platform specific bindings. Pre Kotlin 2.0 this isn't a problem in some cases because common source sets can (incorrectly) reference generated platform code. However once Kotlin 2.0 is released this won't work anymore for any of the cases. To solve the issue, all downstream components (which is ~99% of the components in my project) will need to specify
expect/actual
declarations for the
create
functions for each platform (this project supports 5 platform targets) in each module (and I typically have 1 downstream component per module). That's kind of painful, and I'm wondering if there's a way for kotlin-inject to detect (or be told about) this situation, and generate the
expect/actual
declarations for
create
. I'm not sure if it could be done in the same processor, or if it would need a different processor, or if it's even possible with KSP at all (I think it would need something like Support source set-specific code generation in Multiplatform projects). In any case, I wanted to gather some thoughts and suggestions on this.