Skip to content

update_list fails when new and old element is a list #201

Closed
@vspinu

Description

@vspinu

It seem to fail in the case of a transformations only:

These two work as expected:

> str(update_list(list(a = 1, b = 2), a = ~ list(a)))
List of 2
 $ a:List of 1
  ..$ : num 1
 $ b: num 2
> str(update_list(list(a = 1, b = 2), c = ~ list(a)))
List of 3
 $ a: num 1
 $ b: num 2
 $ c:List of 1
  ..$ : num 1

This one fails

> str(update_list(list(a = list(1), b = 2), a = ~ list(a)))
List of 2
 $ a:List of 1
  ..$ : num 1
 $ b: num 2

Expected result contains a doublly nested list:

> str(list(a = list(list(1)), b = 2))
List of 2
 $ a:List of 1
  ..$ :List of 1
  .. ..$ : num 1
 $ b: num 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions