-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Runtime] Allow casts from AnyHashable to a Hashable enum to succeed. #21044
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
Conversation
@swift-ci please test |
Build failed |
cb350ca
to
2fad867
Compare
@swift-ci please test |
Build failed |
Build failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
stdlib/public/runtime/Casting.cpp
Outdated
@@ -2437,6 +2437,15 @@ static bool swift_dynamicCastImpl(OpaqueValue *dest, OpaqueValue *src, | |||
cast<StructMetadata>(targetType), | |||
flags); | |||
} | |||
|
|||
// AnyHashable casts for enums. | |||
if (targetType->getKind() == MetadataKind::Enum) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just else
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I was trying to be explicit but it ended up a bit awkward. The comment alone is sufficient.
rdar://problem/46472361
2fad867
to
6f7143b
Compare
@swift-ci please smoke test and merge |
1 similar comment
@swift-ci please smoke test and merge |
rdar://problem/46472361