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

To* coercers for numbers and vectors should throw error when input is incompatible #852

Open
10 tasks
ccfontes opened this issue Nov 1, 2023 · 0 comments
Open
10 tasks
Assignees

Comments

@ccfontes
Copy link
Contributor

ccfontes commented Nov 1, 2023

Describe the bug
To* coercers for numbers and vectors accept input string and number incompatible with target type, silently converting input into a unspecified value.

Some of the affected coercers:

  • ToFloat
  • ToFloat2
  • ToFloat3
  • ToFloat4
  • ToInt
  • ToInt2
  • ToInt3
  • ToInt4
  • ToInt8
  • ToInt16

To Reproduce

"1" | ToInt2 | Log
;=> (1 0)
"abc" | ToFloat | Log
;=> 0

Expected behavior
Affected To* for numbers and vectors should throw error when input is incompatible with target type.

@sinkingsugar sinkingsugar self-assigned this Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants