Skip to content

[4.1][stdlib] Fix signature error in two IndexDistance compatibility shims #14444

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

Conversation

airspeedswift
Copy link
Member

@airspeedswift airspeedswift commented Feb 6, 2018

• Explanation: Two source compatibility shims for code that assumed non-Int index distance had minor method signature erros, so weren’t forwarding on to the correct Int-based underlying implementation, instead they were calling themselves.
• Scope of Issue: In the case of calling into these compatibility shims, they would recurse and crash at runtime instead of forwarding on to the underlying implementation.
• Origination: When the other compatibility shims for IndexDistance were originally added, these two were commented out due to a compiler crash. When that crash was fixed, they were uncommented but still needed tests.
• Risk: Low risk; these two methods (formIndex(after:) and index(_:offsetBy:limitedBy)) are fairly rarely used.
• Reviewed By: @moiseev
• Testing: Regular regression tests, plus additional tests that simulate the compatibility issue the shims resolve.
• Radar / SR: rdar://problem/37290679

airspeedswift and others added 2 commits February 6, 2018 12:50
* Fix compatibility shims for IndexDistance

* Add a second test for implied IndexDistance, Bidirectional conformance
@airspeedswift airspeedswift requested a review from moiseev February 6, 2018 23:15
@airspeedswift
Copy link
Member Author

@swift-ci please test

@airspeedswift
Copy link
Member Author

@swift-ci please nominate

@airspeedswift airspeedswift merged commit 4e7b4de into swiftlang:swift-4.1-branch Feb 7, 2018
airspeedswift added a commit to airspeedswift/swift that referenced this pull request Feb 8, 2018
…shims (swiftlang#14444)

* [stdlib] Collection compatibility shim fixes (swiftlang#14342)

* Fix compatibility shims for IndexDistance

* Add a second test for implied IndexDistance, Bidirectional conformance

* Merge pull request swiftlang#14414 from airspeedswift/move-collection-compat
airspeedswift added a commit that referenced this pull request Feb 8, 2018
…shims (#14444) (#14476)

* [stdlib] Collection compatibility shim fixes (#14342)

* Fix compatibility shims for IndexDistance

* Add a second test for implied IndexDistance, Bidirectional conformance

* Merge pull request #14414 from airspeedswift/move-collection-compat
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.

2 participants