Skip to content

Commit 70efa0b

Browse files
committed
[TypeChecker] [NFC] Make unreachable case unreachable
A part of swift::diagnoseExplicitUnavailability() that should never run for deprecations looks for them and handles them with “break”. Change this to llvm_unreachable() so we notice if this somehow happens. This change *should* be NFC; I’m splitting it out from other changes so that bisections can point to it if it causes problems in the future.
1 parent 5a27eb4 commit 70efa0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/TypeCheckAvailability.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2116,7 +2116,7 @@ bool swift::diagnoseExplicitUnavailability(
21162116
auto &diags = ctx.Diags;
21172117
switch (Attr->getPlatformAgnosticAvailability()) {
21182118
case PlatformAgnosticAvailabilityKind::Deprecated:
2119-
break;
2119+
llvm_unreachable("shouldn't see deprecations in explicit unavailability");
21202120

21212121
case PlatformAgnosticAvailabilityKind::None:
21222122
case PlatformAgnosticAvailabilityKind::Unavailable:

0 commit comments

Comments
 (0)