Skip to content

Commit 615b8be

Browse files
author
Harlan Haskins
committed
[stdlib] Silence warnings related to uninhabited types
PR #20528 was merged yesterday, which inserts an `unreachable` in functions with uninhabited parameters. Unfortunately this means any statement in the function body, even ones that themselves are never-returning or don't have any executable code, cause the warning. Silence the warnings by deleting the bodies of these functions.
1 parent 28962b5 commit 615b8be

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

stdlib/public/core/Policy.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ extension Never: Equatable {}
3434

3535
extension Never: Comparable {
3636
public static func < (lhs: Never, rhs: Never) -> Bool {
37-
switch (lhs, rhs) {
38-
}
3937
}
4038
}
4139

stdlib/public/core/Range.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ public enum UnboundedRange_ {
772772
/// The unbounded range operator (`...`) is valid only within a collection's
773773
/// subscript.
774774
public static postfix func ... (_: UnboundedRange_) -> () {
775-
fatalError("uncallable")
775+
// This function is uncallable
776776
}
777777
}
778778

0 commit comments

Comments
 (0)