-
Notifications
You must be signed in to change notification settings - Fork 998
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
nested ':=' reference assignment fails #6768
Comments
There is a workaround of returning a containing the results of the inner and outer function and assigning them all at once, however this structure was more desirable. |
could you confirm (1) whether the issue is present on CRAN (2) whether updating to the current version of data.table fixes the issue? There are some recent related commits that might fix it |
Thank you, the latest CRAN does indeed resolve this issue! |
Great! Please also check on the current devel version, this is probably due to #6551 |
I see the same behavior on 1.16.0, 1.16.4 and current
It's definitely odd that you've managed to create a column that's just Could you double check & report which version produces the correct result? |
I went back as far as 1.13.0 and was unable to find a version that produces the correct result, however I believe I found the root of the confusion:
The second occurrence of the assignment statement produces the correct result. I believe this is what occurred when I first tested the latest CRAN version. |
*Followed TODO: by mattdowle from resolution to '2-space indentation Rdatatable#2420' *Added tests for jsub that modify DT by-reference *Added test case for interger vector indexing
Issues arise when a function called in by-reference modification, modifies the dt by reference as well. Below is the example running on the latest dev version. The result of the outer function overwrites the inner function in the incorrect column name, the column named new is left empty.
The text was updated successfully, but these errors were encountered: