Skip to content

Commit 6774f7b

Browse files
committed
Update for SE-0110 -- @NoReturn attribute replaced with Never type
1 parent 2aac7ec commit 6774f7b

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Sources/Commands/Error.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extension Error: FixableError {
5050
}
5151
}
5252

53-
@noreturn public func handle(error: Any, usage: ((String) -> Void) -> Void) {
53+
public func handle(error: Any, usage: ((String) -> Void) -> Void) -> Never {
5454

5555
switch error {
5656
case OptionParserError.multipleModesSpecified(let modes):

Sources/POSIX/exit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
import libc
1212

13-
@noreturn public func exit(_ status: Int32) {
13+
public func exit(_ status: Int32) -> Never {
1414
libc.exit(status)
1515
}

Sources/POSIX/getcwd.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import var libc.errno
2828
*/
2929
public func getcwd() -> String {
3030

31-
@noreturn func error() {
31+
func error() -> Never {
3232
fputs("error: no current directory\n", libc.stderr)
3333
libc.exit(2)
3434
}

Sources/Utility/Git.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class Git {
9999
return Int(String(first))
100100
}
101101

102-
@noreturn public class func checkGitVersion(_ error: Swift.Error) throws {
102+
public class func checkGitVersion(_ error: Swift.Error) throws -> Never {
103103
// Git 2.0 or higher is required
104104
if let majorVersion = Git.majorVersionNumber, majorVersion < 2 {
105105
// FIXME: This does not belong here.

0 commit comments

Comments
 (0)