Skip to content

fix minor mistake #10839

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
Jul 11, 2017
Merged

fix minor mistake #10839

merged 2 commits into from
Jul 11, 2017

Conversation

Tw1stFate
Copy link
Contributor

Use the flatMap method. Parameter transform: A closure that takes the unwrapped value, right?
and the example's result is 1764, not 1746.

Use the `flatMap` method. Parameter transform: A closure that takes the unwrapped value, right?
///
/// - Parameter transform: A closure that takes the unwrapped value
/// of the instance.
/// - Returns: The result of the given closure. If this instance is `nil`,
/// returns `nil`.
@_inlineable
public func flatMap<U>(
_ transform: (Wrapped) throws -> U?
_ transform: (Unwrapped) throws -> U?
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this compile? I assume Wrapped is the type that comes from the generic parametrization of Optional<Wrapped>, i.e. it's not really a parameter name that can be changed.

Copy link
Contributor

Choose a reason for hiding this comment

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

This change is also outside the scope of the documentation change and should be reverted.

Copy link
Contributor Author

@Tw1stFate Tw1stFate Jul 11, 2017

Choose a reason for hiding this comment

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

you're right. I ignored the Optional<Wrapped> and just look at the surface. and please modify the example's result 1764. and I will close this. I'm new to swift, thanks for feedback.

@CodaFi
Copy link
Contributor

CodaFi commented Jul 11, 2017

Good catch, thanks!

⛵️

@CodaFi
Copy link
Contributor

CodaFi commented Jul 11, 2017

@swift-ci please smoke test

@CodaFi CodaFi merged commit 51eac53 into swiftlang:master Jul 11, 2017
@Tw1stFate Tw1stFate deleted the RushingTwist-patch-1 branch March 7, 2018 10:38
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