Skip to content

Commit ca3acfd

Browse files
authored
Merge pull request swiftlang#15039 from gottesmm/pr-8840a7d3dda61ba61ad551cc6cece87b78fece99
2 parents eaafe33 + 7f9e322 commit ca3acfd

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

stdlib/public/runtime/ReflectionMirror.mm

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -635,19 +635,20 @@ auto call(OpaqueValue *passedValue, const Metadata *T, const Metadata *passedTyp
635635

636636
/// TODO: Implement specialized mirror witnesses for all kinds.
637637
case MetadataKind::Function:
638-
case MetadataKind::Existential: {
639-
OpaqueImpl impl;
640-
return call(&impl);
641-
}
638+
case MetadataKind::Existential:
639+
break;
642640

643641
// Types can't have these kinds.
644642
case MetadataKind::HeapLocalVariable:
645643
case MetadataKind::HeapGenericLocalVariable:
646644
case MetadataKind::ErrorObject:
647645
swift::crash("Swift mirror lookup failure");
648-
}
646+
}
649647

650-
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
648+
// If we have an unknown kind of type, or a type without special handling,
649+
// treat it as opaque.
650+
OpaqueImpl impl;
651+
return call(&impl);
651652
}
652653

653654
} // end anonymous namespace
@@ -738,7 +739,7 @@ char swift_reflectionMirror_displayStyle(OpaqueValue *value, const Metadata *T)
738739
return "(ErrorType Object)";
739740
}
740741

741-
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
742+
return "(Unknown)";
742743
}
743744

744745
#if SWIFT_OBJC_INTEROP

0 commit comments

Comments
 (0)