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

TypeError: array is undefined slicing an array at the end in current elm #900

Closed
prozacchiwawa opened this Issue Aug 20, 2017 · 2 comments

Comments

Projects
None yet
4 participants
@prozacchiwawa

prozacchiwawa commented Aug 20, 2017

Although the previous issues with arrays have been closed, I see this error using recent elm (confirmed on ellie-app and elm-lang.org/try) when slicing zero elements from the end of an array.

https://ellie-app.com/45rwKnNgpwVa1/0

full example:

module Main exposing (..)

import Html exposing (Html, text)
import Array

main : Html a
main =
    let end = 200 in
    let x = Array.initialize end identity in
    text (toString (Array.slice end end x))

Throws:

TypeError: array is undefined

Stack Trace:

length http://elm-lang.org/compile:956:1
sliceLeft http://elm-lang.org/compile:634:10
slice http://elm-lang.org/compile:555:9
A3 http://elm-lang.org/compile:99:7
_user$project$Temp1503266268830868$main< http://elm-lang.org/compile:7800:5
http://elm-lang.org/compile:7795:2

Expected:

Array.fromList []

@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Aug 20, 2017

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot commented Aug 20, 2017

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@Skinney

This comment has been minimized.

Show comment
Hide comment
@Skinney

Skinney Aug 21, 2017

Contributor

It's been fixed in the next version of Elm. In the meantime, you can use Skinney/elm-array-exploration, which is the new array implementation available as a third-party library.

Contributor

Skinney commented Aug 21, 2017

It's been fixed in the next version of Elm. In the meantime, you can use Skinney/elm-array-exploration, which is the new array implementation available as a third-party library.

@evancz evancz closed this Aug 21, 2017

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