https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
w

william

11/03/2020, 1:27 PM
i am passing lambdas to some native libraries (iOS) - do I need to freeze the lambda before passing it on? how would you mutate a lambda anyway? would calling it be considered mutation?
s

streetsofboston

11/03/2020, 1:33 PM
It's not so much that the lambda itself would be mutable (it is not), but the variables in its captured scope may be mutable and may need freezing. And easiest way to make sure all its captured vars are frozen, you can freeze the lambda
w

william

11/03/2020, 1:38 PM
ah ok, i forgot that connected objects are frozen too. ok that seems reasonable. i have something weird that i am pretty sure is a bug then
3 Views