Skip to content

[wip] Bool toggle implementation #14586

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 2 commits into from
Mar 16, 2018

Conversation

chriseidhof
Copy link
Contributor

This pull-request accompanies SE-0199: Adding toggle to Bool

I don't know how to run the test suite and what the standards are for documentation. I'm happy to improve on the PR if someone with more knowledge can point things out.

@xwu
Copy link
Collaborator

xwu commented Feb 13, 2018

@swift-ci Please smoke test

@xwu xwu added the swift evolution pending discussion Flag → feature: A feature that has a Swift evolution proposal currently in review label Feb 13, 2018
Copy link
Collaborator

@xwu xwu left a comment

Choose a reason for hiding this comment

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

You'll need to add public :)

Seems like it'd make sense for this to be _transparent too.

///
/// bools[0].toggle()
/// // bools now contains [false, false]
mutating func toggle() {
Copy link
Member

Choose a reason for hiding this comment

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

Needs to be public

@@ -294,3 +294,19 @@ extension Bool {
return lhs ? true : try rhs()
}
}

extension Bool {
@_inlineable // FIXME(sil-serialize-all)
Copy link
Member

Choose a reason for hiding this comment

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

I think you can drop the FIXME(sil-serialize-all) for this one. It's truly legitimately inlineable.

@gottesmm
Copy link
Contributor

@chriseidhof We have in the docs directory information about the CI and testing. For the CI commands:

https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md

For the testing:

https://github.com/apple/swift/blob/master/docs/Testing.md

If you have any comments/improvements, they are welcome as always = ).

@airspeedswift
Copy link
Member

@swift-ci please test

@swiftlang swiftlang deleted a comment from swift-ci Mar 8, 2018
@airspeedswift airspeedswift merged commit 86fb3fa into swiftlang:master Mar 16, 2018
@ryanmaxwell
Copy link

why no func toggled() -> Selfas a pair with mutating func toggle()?

@xwu
Copy link
Collaborator

xwu commented Jun 5, 2018

That method already exists and is spelled ~. API design issues are discussed on the Swift forums and you can review the extensive comments there.

@AnthonyLatsis AnthonyLatsis added feature A feature request or implementation standard library Area: Standard library umbrella swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented and removed swift evolution pending discussion Flag → feature: A feature that has a Swift evolution proposal currently in review labels Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A feature request or implementation standard library Area: Standard library umbrella swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants