New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setDT
Fails to Detect Locked Objects In Corner Case
#1827
Comments
Unfortunately locked binding allows an object to be modified by reference. |
You could check whether Alternatively, duplicate the object if |
Brodie, those won't work since all data.frames have |
Didn't realize that. Do you want me to close this or just leave it here as |
It's better to have it open, since it's still an issue. I labelled it just for easier searching. |
Warning, running the following code will modify objects in locked namespaces:
Obviously this happens because
mtcars
is never copied sincemtcars2
is not touched. This bypasses thesetDT
safety check because the namemtcars2
is defined in.RGlobalEnv
and is not locked, even though the associated SEXP is still the one inpackage:datasets
.This actual issue came up in the following example:
Where magrittr "copies"
mtcars
to.
, but since.
isn't modified, it still points to the originalmtcars
SEXP.The text was updated successfully, but these errors were encountered: