We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 48f63c5 + 369e7d3 commit 7bcf1fcCopy full SHA for 7bcf1fc
include/swift/Reflection/TypeRef.h
@@ -1024,6 +1024,10 @@ class TypeRefVisitor {
1024
public:
1025
1026
RetTy visit(const TypeRef *typeRef, Args... args) {
1027
+ // We shouldn't get a NULL typeRef, but handle it gracefully if we do.
1028
+ if (!typeRef)
1029
+ return RetTy();
1030
+
1031
switch (typeRef->getKind()) {
1032
#define TYPEREF(Id, Parent) \
1033
case TypeRefKind::Id: \
@@ -1033,7 +1037,9 @@ class TypeRefVisitor {
1037
#include "swift/Reflection/TypeRefs.def"
1034
1038
}
1035
1039
1036
- swift_unreachable("Unhandled TypeRefKind in switch.");
1040
+ // We shouldn't get an unknown kind, but bad data might result in an unknown
1041
+ // value showing up here. Handle it gracefully when that happens.
1042
1043
1044
};
1045
0 commit comments