Skip to content

Add 'bitPattern:' label to '(U)Int.init(ObjectIdentifier)' #3634

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

aschwaighofer
Copy link
Contributor

Add 'bitPattern:' label to '(U)Int.init(ObjectIdentifier)'

This the patch for swift-evolution proposal 0124.

SR-2064
rdar://27327186

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please smoke test

@aschwaighofer aschwaighofer force-pushed the int_init_objectidentifier_label branch from 20d7e29 to 46a81cd Compare July 20, 2016 19:17
@aschwaighofer
Copy link
Contributor Author

@swift-ci Please smoke test linux

@aschwaighofer aschwaighofer added the swift evolution pending discussion Flag → feature: A feature that has a Swift evolution proposal currently in review label Jul 20, 2016
@@ -631,3 +631,17 @@ extension ObjectIdentifier {
Builtin.unreachable()
}
}

extension UInt {
@available(*, unavailable, message: "use the 'UInt(bitPattern:)' initializer")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use renamed="init(bitPattern:)" so that users will get a fixit?

@gribozavr
Copy link
Contributor

Just two small suggestions, but LGTM otherwise! Thank you!

public init(_ objectID: ObjectIdentifier) {
Builtin.unreachable()
}
}

extension Int {
@available(*, unavailable, message: "use the 'Int(bitPattern:)' initializer")
@available(*, unavailable, message: "init(bitPattern:)")
public init(_ objectID: ObjectIdentifier) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would be 'renamed' not 'message' will fix.

@aschwaighofer aschwaighofer force-pushed the int_init_objectidentifier_label branch from 42725f7 to b6da135 Compare July 21, 2016 02:01
@aschwaighofer aschwaighofer added swift evolution approved Flag → feature: A feature that was approved through the Swift evolution process and removed swift evolution pending discussion Flag → feature: A feature that has a Swift evolution proposal currently in review labels Jul 21, 2016
@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test and merge

@lattner lattner merged commit f207607 into swiftlang:master Jul 21, 2016
@lattner
Copy link
Contributor

lattner commented Jul 21, 2016

Failure looks spurious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
swift evolution approved Flag → feature: A feature that was approved through the Swift evolution process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants