Skip to content

ensure NonEmptyList properties are immutable#1418

Merged
pakoito merged 1 commit intoarrow-kt:masterfrom
billwanjohi:hotfix/make_nonemptylist_immutable
Apr 23, 2019
Merged

ensure NonEmptyList properties are immutable#1418
pakoito merged 1 commit intoarrow-kt:masterfrom
billwanjohi:hotfix/make_nonemptylist_immutable

Conversation

@billwanjohi
Copy link
Contributor

Fixes #1312

Call toList() on List constructor arguments to ensure that the new
object is unaffected by any mutations on its inputs.

Without this, a mutable list can be stored as either the all or tail
property of the NonEmptyList, which is affected by all changes, but is
then out of sync with the other properties.

Fixes arrow-kt#1312

Call toList() on List constructor arguments to ensure that the new
object is unaffected by any mutations on its inputs.

Without this, a mutable list can be stored as either the `all` or `tail`
property of the NonEmptyList, which is affected by all changes, but is
then out of sync with the other properties.
@pakoito pakoito merged commit 269659c into arrow-kt:master Apr 23, 2019
@billwanjohi billwanjohi deleted the hotfix/make_nonemptylist_immutable branch April 23, 2019 20:59
@raulraja raulraja mentioned this pull request Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: NonEmptyList derived directly from MutableList propagates changes to #all property, but not #size, #head and #tail

2 participants