Open jfontsaballs opened 6 months ago
After some more testing, it seems the problem is that verify uses the constructor parameter list even if, in the module, the instance is constructed inside a lambda which does not use that constructor or that manually passes constructor parameters or uses default values.
Here is a small snippet that I think shows the problem:
class MyClass(val myDependency: okhttp3.HttpUrl = "https://google.com".toHttpUrl())
module {
single { MyClass() } //This works perfectly at runtime but will throw during verification
}
Yeah, you are declaring a function definition here. Verify is not fully stable on that. You could better extract a function to be called in the definition. Give a try
Describe the bug This test throws:
To Reproduce Run the test.
Expected behavior Verification passes as there is only a singleton configured with no dependencies.
Koin module and version:
Snippet or Sample project to help reproduce See test above.