Skip to content

Commit 8ca6191

Browse files
authored
Merge pull request #517 from slavapestov/update-for-never-noreturn
Update for SE-0102 -- @NoReturn attribute replaced with Never type
2 parents 2c1b4cf + 4640348 commit 8ca6191

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
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
}

0 commit comments

Comments
 (0)