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

modBy runtime error when passing 0 as an argument #1147

Open
glensargent opened this issue Aug 31, 2024 · 1 comment
Open

modBy runtime error when passing 0 as an argument #1147

glensargent opened this issue Aug 31, 2024 · 1 comment

Comments

@glensargent
Copy link

glensargent commented Aug 31, 2024

modBy takes any integer as an input and therefore it's possible (and quite frequent if you're running it on indexes) to attempt to divide by 0 which provides a runtime error:
image

The elm lsp/compiler provides no warning for this and it successfully compiles, which contradicts the 'no runtime exceptions' rule

Easy issue to replicate, just pass 0 in to modBy. I'm unsure if this is intentional behaviour or not but after a day of writing elm it caught me off guard to have my first runtime error

Copy link

Thanks for reporting this! To set expectations:

  • Issues are reviewed in batches, so it can take some time to get a response.
  • Ask questions a community forum. You will get an answer quicker that way!
  • If you experience something similar, open a new issue. We like duplicates.

Finally, please be patient with the core team. They are trying their best with limited resources.

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