Skip to content

[embedded] Support Dictionary.init(uniqueKeysWithValues:) in Embedded Swift #78919

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 3 commits into from
Jan 31, 2025

Conversation

kubamracek
Copy link
Contributor

See attached test case -- currently, attempting to use Dictionary.init(uniqueKeysWithValues:) results in:

Cannot use a value of protocol type ‘any Error’ in embedded Swift
Cannot do dynamic casting in embedded Swift

Both the errors are a result of using untyped throws in the implementation of Dictionary.init(uniqueKeysWithValues:). Let's avoid that by using typed throws instead.

rdar://143089660

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@phausler phausler left a comment

Choose a reason for hiding this comment

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

Restricting it to embedded seems like the right move for now.

@kubamracek kubamracek merged commit 3afe8eb into swiftlang:main Jan 31, 2025
5 checks passed
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.

2 participants