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

Runtime Exception with List.append. TypeError: undefined is not an object (evaluating 'xs.ctor') #728

Closed
That-David-Guy opened this Issue Oct 2, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@That-David-Guy

That-David-Guy commented Oct 2, 2016

Version: Elm v0.17

This elm code:

-- [1, 2, 3] doesn't matter, it is the two b's that cause the error
b = [1, 2, 3] |> List.append b
-- OR
b = List.append b [1, 2, 3]
-- OR
b = List.append [1, 2, 3] b

Cause the following runtime exception (i.e. in my Chrome console window, not the elm compile error message)

TypeError: undefined is not an object (evaluating 'xs.ctor')

It seems like the bug is because I shouldn't be using 'b' twice like that. Normally I wouldn't log an issue like this (because it was my fault). But since one of Elms selling points is No Runtime Exceptions, I thought you might want to know.

Cheers

@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Oct 2, 2016

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 Oct 2, 2016

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.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Oct 2, 2016

Contributor

This issue has been reported many times. In the next release of Elm, this kind of recursive value definition will be rejected by the compiler.

Contributor

jvoigtlaender commented Oct 2, 2016

This issue has been reported many times. In the next release of Elm, this kind of recursive value definition will be rejected by the compiler.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Oct 3, 2016

Member

The issue is elm/compiler#873 and will be detected in 0.18 of Elm.

@jvoigtlaender, I know this issue is annoying, but try not to take it out on people who are just trying to be helpful!

Member

evancz commented Oct 3, 2016

The issue is elm/compiler#873 and will be detected in 0.18 of Elm.

@jvoigtlaender, I know this issue is annoying, but try not to take it out on people who are just trying to be helpful!

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Oct 3, 2016

Contributor

@evancz, I'm sorry, I honestly don't know what you mean. In what way was I taking something out on somebody? I was just giving the best answer I could. Except for not providing the link to the specific issue in the other repo. And that was simply because I was on mobile, where it's more complicated (for me) to insert links. Oh well, I could have not answered at that time and leave it for later. Other than that, I'm afraid you are seeing ghosts (in seeing unfriendliness in my answering).

Contributor

jvoigtlaender commented Oct 3, 2016

@evancz, I'm sorry, I honestly don't know what you mean. In what way was I taking something out on somebody? I was just giving the best answer I could. Except for not providing the link to the specific issue in the other repo. And that was simply because I was on mobile, where it's more complicated (for me) to insert links. Oh well, I could have not answered at that time and leave it for later. Other than that, I'm afraid you are seeing ghosts (in seeing unfriendliness in my answering).

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