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
KotlinNullPointerException: null is passed to non-null parameter s in Stuff.constructor
The value of x is null at the point of Stuff constructor call, because the Funvals are initialized in order.
Because it's in a function, Kotlin thinks it's safe, when inlined the problem becomes obvious.
Is there anything similar already?
The text was updated successfully, but these errors were encountered:
It is standart puzzler with non-initialized property. I dont know whether it exits in Anton's collection, but I have seen it many times in other sources.
What will this print?
solution
KotlinNullPointerException
:null
is passed to non-null parameters
inStuff.constructor
The value of
x
is null at the point of Stuff constructor call, because theFun
val
s are initialized in order.Because it's in a function, Kotlin thinks it's safe, when inlined the problem becomes obvious.
Is there anything similar already?
The text was updated successfully, but these errors were encountered: