Skip to content

[stdlib] fix an accidental recursion bug involving Collection #38161

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

Merged
merged 1 commit into from
Jul 1, 2021

Conversation

glessard
Copy link
Contributor

@glessard glessard commented Jun 29, 2021

  • adds a default implementation of Collection’s subscript(bounds: Range<_>) with the most general signature possible
  • it is marked unavailable in order to prevent the infinite recursion bug reported in SR-14848
  • Collections whose SubSequence is Slice<Self> still get the proper default.

Resolves SR-14848

@glessard glessard self-assigned this Jun 29, 2021
@glessard
Copy link
Contributor Author

@swift-ci please smoke test

@glessard glessard force-pushed the sr14848 branch 2 times, most recently from 9360ff1 to f366aba Compare June 30, 2021 19:50
@glessard
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, assuming we add @_alwaysEmitIntoClient as described below.

- adds a default implementation of Collection’s subscript(bounds: Range<_>)
  with the most general signature possible
- it is marked unavailable in order to prevent the
  infinite recursion bug reported in SR-14848
- Collections whose SubSequence is Slice<Self> still get the proper default, as intended.
@glessard
Copy link
Contributor Author

glessard commented Jul 1, 2021

@swift-ci please smoke test

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.

3 participants