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

Conversion of string vector to string scalar fails with "not a string object" #102

Closed
clauswilke opened this issue Dec 28, 2020 · 0 comments · Fixed by #226
Closed

Conversion of string vector to string scalar fails with "not a string object" #102

clauswilke opened this issue Dec 28, 2020 · 0 comments · Fixed by #226
Labels
enhancement New feature or request

Comments

@clauswilke
Copy link
Member

If a Rust function expecting a single string is handed a string vector from R, then it raises an error stating "not a string object". See here:

expect_error(.Call(wrap__char_scalar, c("hello", "world")), "not a string object") # why this error message and not "Input must be of length 1"?

The error is appropriate, but the error message is confusing. A better error would be "Input must be of length 1", as is used for the other types, see e.g. here:

expect_error(.Call(wrap__double_scalar, c(.45, .46)), "Input must be of length 1")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant