Skip to content

map_vec() fails on empty named lists() #1206

@khusmann

Description

@khusmann

Empty lists map_vec() to NULL, as expected:

map_vec(list(), identity)
#> NULL

But empty named lists fail (looks like because they try to restore the names on NULL):

map_vec(setNames(list(), character()), identity)
#> Error in names(x) <- names : attempt to set an attribute on NULL

Expected behavior: named lists should also just map_vec() to NULL, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions