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.Append mutates first argument when result is small #802

Closed
zynque opened this Issue Jan 5, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@zynque

zynque commented Jan 5, 2017

Array.Append should not alter the two arrays passed to this function, however, when the resulting array is 32 elements or less, the array value passed as the first argument gets mutated.

Elm.Core version: 5.0.0
Browser/OS: Chrome 55.0.2883.87 m / Windows 10

Example of this behavior:

a1 = Array.repeat 20 1 
a2 = Array.repeat 12 2
a3 = Array.append a1 a2

-- a1: Array.fromList [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2]
-- a2: Array.fromList [2,2,2,2,2,2,2,2,2,2,2,2]
-- a3: Array.fromList [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2]

a4 = Array.repeat 20 1
a5 = Array.repeat 13 2
a6 = Array.append a4 a5

-- a4: Array.fromList [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
-- a5: Array.fromList [2,2,2,2,2,2,2,2,2,2,2,2,2]
-- a6: Array.fromList [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2]
@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Jan 5, 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 Jan 5, 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.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Jan 5, 2017

Contributor

Duplicate, covered in https://github.com/elm-lang/core/issues/649, isn't it?

Contributor

jvoigtlaender commented Jan 5, 2017

Duplicate, covered in https://github.com/elm-lang/core/issues/649, isn't it?

@zynque

This comment has been minimized.

Show comment
Hide comment
@zynque

zynque Jan 5, 2017

Apologies for the oversight. Thanks for closing!

zynque commented Jan 5, 2017

Apologies for the oversight. Thanks for closing!

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