elm/core

Integer division by 0 should error

Closed this issue · 1 comments

Currently this:

import Graphics.Element

main = Graphics.Element.show (1 // 0)

prints zero, whereas this:

import Graphics.Element

main = Graphics.Element.show (1 % 0)

raises a runtime error.

Raising a runtime error on 1 % 0 was a conscious decision, see elm/compiler#262 (comment), and it seems that 1 // 0 should behave accordingly.

Closing this for the more comprehensive #590.