Skip to content
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

permit the use of arrays as tuples #53

Merged
merged 1 commit into from
Apr 10, 2016
Merged

permit the use of arrays as tuples #53

merged 1 commit into from
Apr 10, 2016

Conversation

davidchambers
Copy link
Member

Commit message:

It's not currently safe to use arrays as tuples due to a bug in the circular-reference detection in _determineActualTypes. Given a value such as ['abc', Right(123)] in an environment containing both Array and Pair (the type comprising all two-element arrays), the function is applied recursively to the nested values once for Array and once for Pair. This is fine in the case of 'abc'; for Right(123), though, this is problematic. The first time, Right(123) is appended to $seen. The second time, the identical object is found in $seen, erroneously indicating a circular reference.

This commit removes the mutation.

It's not currently safe to use arrays as tuples due to a bug in the
circular-reference detection in _determineActualTypes. Given a value
such as ["abc", Right(123)] in an environment containing both Array
and Pair (the type comprising all two-element arrays), the function
is applied recursively to the nested values once for Array and once
for Pair. This is fine in the case of "abc"; for Right(123), though,
this is problematic. The first time, Right(123) is appended to $seen.
The second time, the identical object is found in $seen, erroneously
indicating a circular reference.

This commit removes the mutation.
@davidchambers davidchambers merged commit 97b7e60 into master Apr 10, 2016
@davidchambers davidchambers deleted the dc-tuples branch April 10, 2016 23:07
@davidchambers davidchambers mentioned this pull request Apr 21, 2016
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.

1 participant