Skip to content

Commit 11cff08

Browse files
committed
StdlibUnittest: Add a default case to a switch over a resilient enum
I'm not completely satisfied with this fix because we get a compiler warning when compiling without -enable-resilience. Perhaps we need a policy change that a default case in a switch only generates a warning if the enum is *explicitly* @_fixed_layout (or eventually, @closed or however this attribute ends up being written).
1 parent 138bbe2 commit 11cff08

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ extension ProcessTerminationStatus {
412412
return false
413413
case .signal(let signal):
414414
return CInt(signal) == SIGILL || CInt(signal) == SIGTRAP
415+
default:
416+
fatalError("Bad ProcessTerminationStatus")
415417
}
416418
}
417419
}

0 commit comments

Comments
 (0)