Skip to content

[stdlib] Add Swift 3 compatibility for String.init from old integer protocols #8926

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
Apr 22, 2017

Conversation

airspeedswift
Copy link
Member

@airspeedswift airspeedswift commented Apr 21, 2017

Adds Swift-4-obsoleted versions that to signed/unsigned without them being fixed-width.

rdar://problem/31727219

@airspeedswift
Copy link
Member Author

@swift-ci Please test

@airspeedswift airspeedswift requested a review from moiseev April 21, 2017 21:57
@available(swift, obsoleted: 4)
public init<T : FixedWidthInteger>(
_ value: T, radix: Int = 10, uppercase: Bool = false
) where T : SignedInteger {
Copy link
Contributor

Choose a reason for hiding this comment

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

What if you add this line to the non-obsolete version on FixedWIdthInteger?

Copy link
Member Author

Choose a reason for hiding this comment

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

That would be detrimental to functionality, no? Someone who wants to write an extension on FixedWidthInteger that used this function would need to also constrain their function to either Signed or UnsignedInteger

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - baf303709f195af9685e428243a0e0cc5a48d464
Test requested by - @airspeedswift

@airspeedswift
Copy link
Member Author

@swift-ci Please smoke test

@airspeedswift airspeedswift merged commit 9733d50 into swiftlang:master Apr 22, 2017
airspeedswift added a commit to airspeedswift/swift that referenced this pull request Apr 22, 2017
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