File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -3023,14 +3023,17 @@ _bridgeNonVerbatimFromObjectiveC(
30233023 const_cast <void *>(swift_dynamicCastUnknownClass (sourceValue,
30243024 objectiveCType));
30253025
3026- if (sourceValueAsObjectiveCType) {
3027- // The type matches. _forceBridgeFromObjectiveC returns `Self`, so
3028- // we can just return it directly.
3029- bridgeWitness->forceBridgeFromObjectiveC (
3030- static_cast <HeapObject*>(sourceValueAsObjectiveCType),
3031- destValue, nativeType, nativeType, bridgeWitness);
3032- return ;
3026+ if (!sourceValueAsObjectiveCType) {
3027+ swift::swift_dynamicCastFailure (_swift_getClass (sourceValue),
3028+ objectiveCType);
30333029 }
3030+
3031+ // The type matches. _forceBridgeFromObjectiveC returns `Self`, so
3032+ // we can just return it directly.
3033+ bridgeWitness->forceBridgeFromObjectiveC (
3034+ static_cast <HeapObject*>(sourceValueAsObjectiveCType),
3035+ destValue, nativeType, nativeType, bridgeWitness);
3036+ return ;
30343037 }
30353038
30363039 // Fail.
You can’t perform that action at this time.
0 commit comments