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

[Stdlib] For Collections, the SubSequence of a Subsequence is SubSequence #8888

Merged
merged 2 commits into from Apr 20, 2017

Conversation

DougGregor
Copy link
Member

Part of ABI FIXME #99, this gives us some nice consistency that
ensures that slicing a SubSequence gives us another SubSequence. There
are two source-compatibility implications to this change:

  • Collections now need to satisfy this property, which could not be
    expressed in Swift 3. There might be some Collections that don't
    satisfy this property, and will break with the Swift 4 compiler
    even in Swift 3 compatibility mode. Case in point...
  • The Lazy collection types were formulated as a lazy collection of
    the base slice (e.g., LazyCollection<ArraySlice<T>>) rather than as
    a slice of the lazy collection (e.g.,
    Slice<LazyCollection<Array<T>>). The former doesn't meet the new
    requirements, so change to the latter.

There's a more pervasive issue here that needs further study;
essentially, we can end up with self-derived sources getting
reinjected later, and will either need to avoid that reinjection or
need to expand what this localized hack does, filtering out
self-derived constraints when we enumerate requirements.
…ence.

Part of ABI FIXME apple#99, this gives us some nice consistency that
ensures that slicing a SubSequence gives us another SubSequence. There
are two source-compatibility implications to this change:

* Collections now need to satisfy this property, which could not be
  expressed in Swift 3. There might be some Collections that don't
  satisfy this property, and will break with the Swift 4 compiler
  *even in Swift 3 compatibility mode*. Case in point...
* The Lazy collection types were formulated as a lazy collection of
  the base slice (e.g., LazyCollection<ArraySlice<T>>) rather than as
  a slice of the lazy collection (e.g.,
  Slice<LazyCollection<Array<T>>). The former doesn't meet the new
  requirements, so change to the latter.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@dabrahams and @airspeedswift , you'll be interested in this because it affects compatibility

@dabrahams
Copy link
Collaborator

@airspeedswift specifically, it changes the SubSequence type of the lazy collections. How serious a compatibility break this is, we'll have to see.

@DougGregor DougGregor merged commit 583d567 into apple:master Apr 20, 2017
@DougGregor DougGregor deleted the the-subsequence-of-my-subsequence branch April 20, 2017 22:46
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.

None yet

2 participants