Hi guys! Did somebody face the same behavoiur? <ht...
# koin
m
Hi guys! Did somebody face the same behavoiur? https://github.com/InsertKoinIO/koin/issues/1544
a
is it all the parameter stack cleared then?
m
Clears _parameterStack in Scope.
See org.koin.core.scope.Scope, line 235
a
but here we don't have any resolution result if I understand well, why keep such parameters?
m
As I understand here's all params in the scope. If one time we didn't find it, next time I can not find something else. If I can not find 'A', 'B' clears too.
a
parameters are "temporal " data used, just for one injection
m
F.e. I make single { param1 = getOrNull(), param2 = get() }. First param not provided, then stack clears, and param2 then can not be found too.
Ok but somehow I can get param2 by get if param1 is not null, and can not get it if param1 not found in the scope.
a
complex case here, as you resolution can fail
Then, if you use getOrNull() the stack clears the parameters?
m
Yeah, look at this simple sample. If i try to get nullable value firstly and value couldn't be found, then stack clears, and when I try to get(), I got null pointer exception. I run it with debugger and faced that _parametersStack cleared, and it contains my non nullable value.
Then I tried to get() first and then getOrNull() and it works!
a
yes, last update fix it!