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

Unclear error message: cannot convert argument to native type: failed to convert from int because of... #28

Open
timfennis opened this issue Sep 25, 2024 · 0 comments
Labels
enhancement New feature or request error message An error message was unclear or incorrect

Comments

@timfennis
Copy link
Owner

When you call a native method from Andy C code that requires a usize you get a pretty unhelpful error if the integer value could not be converted into a usize because it was negative.

[1,2,3].truncate(-1);

Results in the unhelpful error:

cannot convert argument to native type: failed to convert from int because of: 'out of range integral type conversion attempted'

A more helpful error would point out that negative numbers aren't allowed here.

@timfennis timfennis added enhancement New feature or request error message An error message was unclear or incorrect labels Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request error message An error message was unclear or incorrect
Projects
None yet
Development

No branches or pull requests

1 participant