Is there a way to prevent and object from being co...
# announcements
c
Is there a way to prevent and object from being copied outside of a lambda with receiver? If it can't be done, can I somehow hide the functions to everything outside of the lambda?
m
What about using a proxy that is made useless after execution?
Added as code snippet instead
c
That's actually a pretty good idea!
s
I don’t think that’ll work quite as written —
useNew()
can’t access that private field, so you’ll need maybe an
internal
setter or another method of indirection there
c
I'm sure something similar would work, though