Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upFixed bug in Array.map and Array.indexedMap #171
Conversation
brown-dragon
changed the title from
Fix bug in Array.map and Array.indexedMap
to
Fixed bug in Array.map and Array.indexedMap
Feb 13, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
brown-dragon
Feb 13, 2015
Contributor
I just realized this bug has been reported in https://github.com/elm-lang/core/pull/169
However this is a better fix, especially because the bug exists in all Array.map calls
(not just the empty case). It is most visible in the empty case but the initialization is
incorrect in all cases.
|
I just realized this bug has been reported in https://github.com/elm-lang/core/pull/169 However this is a better fix, especially because the bug exists in all |
pushed a commit
that referenced
this pull request
Feb 13, 2015
evancz
merged commit 445d76a
into
elm:master
Feb 13, 2015
1 check passed
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Awesome, thanks for the fix! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
TheSeamau5
Feb 16, 2015
Contributor
Yay! Awesome!
By the way, I just ran elm-check on the old code and it has found the bug.
Map transforms lists and arrays equally has failed with the following input: (<function>,Array.fromList [])
I know it's a bit of a shameless plug, but I think we could look into elm-check integration with the current testing of the standard library. I'm pretty surprised by how well elm-check is currently doing.
|
Yay! Awesome! By the way, I just ran elm-check on the old code and it has found the bug.
I know it's a bit of a shameless plug, but I think we could look into elm-check integration with the current testing of the standard library. I'm pretty surprised by how well elm-check is currently doing. |
TheSeamau5
referenced this pull request
Feb 16, 2015
Closed
Uncaught TypeError: Cannot read property 'ctor' of undefined #167
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
pchiusano
commented
Mar 9, 2015
|
Any chance of a 0.14.x patch release for this? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kasbah
Mar 10, 2015
Contributor
Prompted by you @pchiusano, I proposed it for next stable with #192.
|
Prompted by you @pchiusano, I proposed it for next stable with #192. |
brown-dragon commentedFeb 13, 2015
Array.map and Array.indexedMap have a bug that can most easily be seen
with the following use case:
EXPECTED:
Array.empty == Array.map (\e -> e) Array.emptyACTUAL:
Array.empty != Array.map (\e -> e) Array.empty(the same for Array.indexedMap)
This is because Array.map/Array.indexedMap initializes itself
incorrectly using:
instead of
This bug has been fixed in this commit