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

Array.repeat causes a runtime error #175

Closed
TheSeamau5 opened this Issue Feb 16, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@TheSeamau5
Contributor

TheSeamau5 commented Feb 16, 2015

Calling Array.repeat with a negative size causes a runtime error.

Invalid array length

Open the developer console for more details.

This is the code that has caused this:

import Array 
import Text (asText)

main = 
  asText <|
    Array.repeat -5 4

This behavior is not the same as the behavior with lists as calling List.repeat with a negative size yields the empty list.

@mgold

This comment has been minimized.

Show comment
Hide comment
@mgold

mgold Jun 26, 2015

Contributor

@TheSeamau5 I think you can close this now.

Contributor

mgold commented Jun 26, 2015

@TheSeamau5 I think you can close this now.

@TheSeamau5 TheSeamau5 closed this Jun 26, 2015

@sindikat

This comment has been minimized.

Show comment
Hide comment
@sindikat

sindikat Aug 26, 2015

This issue still exists in Elm 0.15.1, just paste this in http://elm-lang.org/try :

import Array
import Graphics.Element exposing (show)
main = show <| Array.repeat (-5) 0

sindikat commented Aug 26, 2015

This issue still exists in Elm 0.15.1, just paste this in http://elm-lang.org/try :

import Array
import Graphics.Element exposing (show)
main = show <| Array.repeat (-5) 0
@mgold

This comment has been minimized.

Show comment
Hide comment
@mgold

mgold Aug 26, 2015

Contributor

The patch was merged after the latest version of core was released. You'll have to wait for 0.16, sorry.

Contributor

mgold commented Aug 26, 2015

The patch was merged after the latest version of core was released. You'll have to wait for 0.16, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment