Skip to content
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

Misleading error messages when subscripting homogenous list #1915

Open
tzakharko opened this issue Mar 2, 2024 · 0 comments
Open

Misleading error messages when subscripting homogenous list #1915

tzakharko opened this issue Mar 2, 2024 · 0 comments

Comments

@tzakharko
Copy link

tzakharko commented Mar 2, 2024

Subscripting a homogenous list by name throws an error "corrupt <var>: no names". I think it would be better to report something like "<var> has no names". Using the term "corrupt" here may confuse the user into thinking that something went terribly wrong at the R side, where the simple fact is that they have been accessing the object incorrectly (I already had a user reporting a bug because of this message).

Current behavior:

x <- vctrs::list_of(1, 2, 3)
x$aa
#> Error: Corrupt x: no names

Suggested behavior:

x <- vctrs::list_of(1, 2, 3)
x$aa
#> Error: x has no named elements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant