Skip to content

[stdlib] Fix mismatched constant name in static func == doc #42531

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 21, 2022

Conversation

Jager-yoo
Copy link
Contributor

@Jager-yoo Jager-yoo commented Apr 21, 2022

  • I've found a mismatched constant name in static func == example. 😄
  • Given the context, it should be numberToMatch, not numberToFind.
  /// You can also use this operator to compare a non-optional value to an
  /// optional that wraps the same type. The non-optional value is wrapped as an
  /// optional before the comparison is made. In the following example, the
  /// `numberToMatch` constant is wrapped as an optional before comparing to the
  /// optional `numberFromString`:

     let **numberToFind**: Int = 23  // → this should be *numberToMatch*
     let numberFromString: Int? = Int("23")      // Optional(23)
     if **numberToFind** == numberFromString {  // → this should be *numberToMatch*
         print("It's a match!")
     }
     // Prints "It's a match!"

- I've found a mismatched constant name in `static func ==` example.
- Given the context, it should be `numberToMatch`, not `numberToFind`.
@Jager-yoo Jager-yoo changed the title Fix mismatched constant name in static func == doc [stdlib] Fix mismatched constant name in static func == doc Apr 21, 2022
@CodaFi
Copy link
Contributor

CodaFi commented Apr 21, 2022

Thanks

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit 11de6d4 into swiftlang:main Apr 21, 2022
@Jager-yoo Jager-yoo deleted the fix-optional-doc branch April 22, 2022 02:05
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