-
Notifications
You must be signed in to change notification settings - Fork 359
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
List.repeat fails (in an ugly way) when given Infinity #1107
Comments
Thanks for reporting this! To set expectations:
Finally, please be patient with the core team. They are trying their best with limited resources. |
I’m working on a PR now. If we really want to optimize it, we could create a new Note: This issue does not apply to |
This isn’t a fix for elm#1107, but a part of a potential one. These `Kernel.Basics` functions will allow a more optimized solution to the `List.repeat` problem
The following code crashes, in a really difficult-to-debug way:
The problem here is that
List.repeat
simply crashes with an out of memory error whenInfinity
is given as the repeat value. None of the major browsers throw error messages that point to the code that caused the OOM error, nor does the Elm REPL (see stack trace below). You also can't debug this error through the performance profilers nor through hitting Pause in any of the script debuggers.I'm not sure if the added overhead of an
isInfinite
check inList.repeat
is worth it, but this is currently a case that is uncovered by #377?Elm REPL stack trace
The text was updated successfully, but these errors were encountered: