arnaud.giuliani
02/13/2026, 5:46 PMJoost Klitsie
02/16/2026, 11:27 AM@Single provideHttpClient(json: Json): HttpClient = .... it stopped working, but it is also doable with simpler objects. So if I have an ExampleObject interface, and I pass the DefaultExampleObject to either a constructor or a module function it doesn't like it, however if I pass the interface it is okay.
interface ExampleObject {
fun getString(): String
}
@Single(binds = [DefaultExampleObject::class, ExampleObject::class])
class DefaultExampleObject() : ExampleObject {
override fun getString(): String {
return "I am a string"
}
}
@Module
@Configuration
@ComponentScan
class ExampleModule {
@Single
fun brokenDefaultExampleObject(exampleObject: DefaultExampleObject): Int = 5
@Single
fun correctExampleObject(exampleObject: ExampleObject): String = exampleObject.getString()
}Joost Klitsie
02/16/2026, 11:27 AMJoost Klitsie
02/16/2026, 11:28 AMJoost Klitsie
02/16/2026, 1:29 PM@InjectedParam private val someId: SomeId?
The epic workaround is to do this: @InjectedParam private val someId: () -> SomeId? and then parametersOf({ myId })arnaud.giuliani
02/16/2026, 2:02 PMJoost Klitsie
02/16/2026, 2:30 PM