@@ -677,7 +677,7 @@ static bool _dynamicCastFromAnyHashable(OpaqueValue *destination,
677
677
678
678
#if !SWIFT_OBJC_INTEROP // __SwiftValue is a native class
679
679
SWIFT_CC (swift) SWIFT_RUNTIME_STDLIB_INTERNAL
680
- bool swift_swiftValueConformsTo(const Metadata *destinationType );
680
+ bool swift_swiftValueConformsTo(const Metadata *, const Metadata * );
681
681
682
682
#define _bridgeAnythingToObjectiveC \
683
683
MANGLE_SYM (s27_bridgeAnythingToObjectiveCyyXlxlF)
@@ -780,14 +780,16 @@ static bool _dynamicCastToExistential(OpaqueValue *dest,
780
780
return true ;
781
781
}
782
782
#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
+ }
791
793
#endif
792
794
793
795
return _fail (src, srcType, targetType, flags);
0 commit comments