You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Graph verification crashes when dependency params contain a lambda.
Koin module and version:
[e.g]: 4.1.0-Beta1
Snippet or Sample project to help reproduce
Add a snippet or even a small sample project to hel reproduce your case.
null cannot be cast to non-null type kotlin.reflect.KClass<*>
java.lang.NullPointerException: null cannot be cast to non-null type kotlin.reflect.KClass<*>
at org.koin.test.verify.Verification.verifyConstructor(Verification.kt:131)
at org.koin.test.verify.Verification.verifyFactory(Verification.kt:70)
at org.koin.test.verify.Verification.verify(Verification.kt:46)
at org.koin.test.verify.Verify.verify(VerifyModule.kt:81)
at org.koin.test.verify.VerifyModuleKt.verify(VerifyModule.kt:30)
<>
Dependency being verified:
// library class, no access to it
actual class LocalGameDataProvider(
private val getGameData: suspend (GameId.Local) -> LocalGameData,
) {
internal actual suspend fun awaitGameData(id: GameId.Local) = getGameData(id)
}
Injected through a builder function:
fun LocalGameDataProvider(
detailsRepo: GameDataRepository, // project classes
metadataRepository: VideoMetadataRepository,
) = LocalGameDataProvider { id ->
// impl
}
val module = module {
singleOf(::LocalGameDataProvider)
}
The text was updated successfully, but these errors were encountered:
This is a current limitation of this implementation. This is not ideal as we try to inspect class metainfo. Lambda is hard to catchup from that, we don't really know what's inside your function. Without any static code analysis, or compiler plugin it's hard to provide something complete on this tooling API. This is why previous proposals were trying to sandbox, it's making your testing part so complex that it becomes hard to maintain on the scale.
More on that, reflection on other targets than JVM is incomplete.
I will continue to catch back on this API, but it's clearly linked to the current DSL design. This is why I'm preparing ground for new proposals around this DSL.
Describe the bug
Graph verification crashes when dependency params contain a lambda.
Koin module and version:
[e.g]: 4.1.0-Beta1
Snippet or Sample project to help reproduce
Add a snippet or even a small sample project to hel reproduce your case.
Dependency being verified:
Injected through a builder function:
The text was updated successfully, but these errors were encountered: