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

writable::list() creates a NULL #166

Closed
hadley opened this issue Apr 8, 2021 · 1 comment
Closed

writable::list() creates a NULL #166

hadley opened this issue Apr 8, 2021 · 1 comment
Assignees
Labels
feature a feature request or enhancement

Comments

@hadley
Copy link
Member

hadley commented Apr 8, 2021

cpp11::cpp_eval("cpp11::writable::list()")
#> NULL

Created on 2021-04-08 by the reprex package (v2.0.0)

@jimhester
Copy link
Member

jimhester commented Apr 8, 2021

This is really the crux of it, the error is coming from the cpp11::list constructor.

cpp11::list foo(cpp11::writable::list())

We could have a more informative error message when a cpp11::writable::list() is passed and the SEXP is R_NilValue, this indicates trying to create a view on a default constructed list.

We also should mark the default constructors as noexcept

@jimhester jimhester added the feature a feature request or enhancement label Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants