Displaying 3 results from an estimated 3 matches for "shallow_duplicate".
2024 Apr 05
1
Bug in out-of-bounds assignment of list object to expression() vector
...fails, raising the error back in
do_subassign2_dflt(), because the assignment kind is invalid: there is
no way to put data.frames into an expression vector. The new resized
`x` is lost, and the old overwritten `x` stays there.
Not sure what the right way to fix this is. It's desirable to avoid
shallow_duplicate(x) for the overwriting assignments, but then the
sub-assignment must either succeed or leave the operand untouched.
Is there a way to perform the type check before overwriting the operand?
--
Best regards,
Ivan
2024 Apr 05
1
[External] Re: Bug in out-of-bounds assignment of list object to expression() vector
...in
> do_subassign2_dflt(), because the assignment kind is invalid: there is
> no way to put data.frames into an expression vector. The new resized
> `x` is lost, and the old overwritten `x` stays there.
>
> Not sure what the right way to fix this is. It's desirable to avoid
> shallow_duplicate(x) for the overwriting assignments, but then the
> sub-assignment must either succeed or leave the operand untouched.
> Is there a way to perform the type check before overwriting the operand?
Yes. There are two places where there are some checks, one early and
the other late. The early one...
2024 Apr 05
3
Bug in out-of-bounds assignment of list object to expression() vector
There seems to be a bug in out-of-bounds assignment of list objects to an
expression() vector. Tested on release and devel. (Many thanks to folks
over at Mastodon for the help narrowing down this bug)
When assigning a list into an existing index, it correctly errors on
incompatible type, and the expression vector is unchanged:
```
x <- expression(a,b,c)
x[[3]] <- list() # Error
x
#>