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 crash when diffing LocalizedStringKey with FormatStyle #98

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

daltonclaybrook
Copy link

This is a partial fix for #97. This fix covers the cases where an interpolation was appended using appendInterpolation(_:format:) but does not cover the other cases mentioned in the issue.

I attempted to fix the others as well and was able to unwrap a (Date, Text.DateStyle), but there doesn't seem to be a publicly-accessible way to use the DateStyle to format the date. Here is a gist that demonstrates unwrapping the DateStyle:
https://gist.github.com/daltonclaybrook/5491f296d9d5806dd31f4d777aea347f

Copy link
Member

@stephencelis stephencelis left a comment

Choose a reason for hiding this comment

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

Great fix, thanks!

@stephencelis
Copy link
Member

Will merge on green. Thanks for the partial fix! If you end up tackling any of the other edge cases we'd happily accept more PRs for them. We'd also accept test cases with XCTExpectFailures showing the deficiencies.

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

2 participants