Description
Describe the bug
When attempting to lookup a definition in a certain Scope which depends on another definition declared in another Scope, the resolution context changes to that other Scope rather than staying in the original one.
Consequently, nested Factory declarations cannot access elements from the original scope.
This is because the logic changed between 4.1.0 Beta 11 and 13:
from a simple Scope#getOrNull
to a more complex logic
(I linked the diff to 4.1.0 as the logic changed slightly between Beta13 and the final release)
Expected behavior
Dependencies are looked up from other Scopes as a fallback, but the original context prevails throughout the nested lookups.
Koin module and version:
koin-core:4.1.0
Snippet or Sample project to help reproduce
https://github.com/SIMULATAN/koin-scope-context-reproducer