Skip to content
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

Fix the defaultValueDescription for string enums whose values differ from the case names #476

Merged
merged 2 commits into from Aug 26, 2022
Merged

Fix the defaultValueDescription for string enums whose values differ from the case names #476

merged 2 commits into from Aug 26, 2022

Conversation

ian-twilightcoder
Copy link
Contributor

defaultValueDescription is always the enum case name, but that's not a valid argument when the enum value differs from the case name. Extend ExpressibleByArgument to use rawValue for defaultValueDescription for string enums.

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

…from the case names

defaultValueDescription is always the enum case name, but that's not a valid argument when the enum value differs from the case name. Extend ExpressibleByArgument to use rawValue for defaultValueDescription for string enums.
@ian-twilightcoder
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@rauhul rauhul left a comment

Choose a reason for hiding this comment

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

LGTM thanks for adding tests too! Probably should wait for Nate's eyes too before merging.

@rauhul
Copy link
Contributor

rauhul commented Aug 26, 2022

@swift-ci please test

Copy link
Member

@natecook1000 natecook1000 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks, @ian-twilightcoder 👏🏻

@natecook1000
Copy link
Member

@swift-ci Please test

@rauhul
Copy link
Contributor

rauhul commented Aug 26, 2022

@swift-ci please test

@rauhul rauhul merged commit 67fa3c0 into apple:main Aug 26, 2022
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.

None yet

3 participants