@@ -677,7 +677,7 @@ static bool _dynamicCastFromAnyHashable(OpaqueValue *destination,
677677
678678#if !SWIFT_OBJC_INTEROP // __SwiftValue is a native class
679679SWIFT_CC (swift) SWIFT_RUNTIME_STDLIB_INTERNAL
680- bool swift_swiftValueConformsTo(const Metadata *destinationType );
680+ bool swift_swiftValueConformsTo(const Metadata *, const Metadata * );
681681
682682#define _bridgeAnythingToObjectiveC \
683683 MANGLE_SYM (s27_bridgeAnythingToObjectiveCyyXlxlF)
@@ -780,14 +780,16 @@ static bool _dynamicCastToExistential(OpaqueValue *dest,
780780 return true ;
781781 }
782782#else // !SWIFT_OBJC_INTEROP -- __SwiftValue is a native class
783- bool isMetatype = kind == MetadataKind::ExistentialMetatype || kind == MetadataKind::Metatype;
784- if (!isMetatype && (isTargetTypeAnyObject || swift_swiftValueConformsTo (targetType))) {
785- auto object = _bridgeAnythingToObjectiveC (src, srcType);
786- swift_retain (object);
787- destExistential->Value = object;
788- maybeDeallocateSource (true );
789- return true ;
790- }
783+ bool isMetatype = kind == MetadataKind::ExistentialMetatype ||
784+ kind == MetadataKind::Metatype;
785+ if (!isMetatype && (isTargetTypeAnyObject ||
786+ swift_swiftValueConformsTo (targetType, targetType))) {
787+ auto object = _bridgeAnythingToObjectiveC (src, srcType);
788+ swift_retain (object);
789+ destExistential->Value = object;
790+ maybeDeallocateSource (true );
791+ return true ;
792+ }
791793#endif
792794
793795 return _fail (src, srcType, targetType, flags);
0 commit comments