Skip to content

Commit c260a4a

Browse files
committed
Small patch to silence warnings
- Remove unreachable `fatalError` - Fix unreachable `return` statement
1 parent 0e39f4f commit c260a4a

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Sources/SwiftDriverExecution/SwiftDriverExecutor.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public final class SwiftDriverExecutor: DriverExecutor {
4747
}
4848

4949
try exec(path: arguments[0], args: arguments)
50-
fatalError("unreachable, exec always throws on failure")
5150
} else {
5251
var childEnv = env
5352
childEnv.merge(job.extraEnvironment, uniquingKeysWith: { (_, new) in new })

Tests/TestUtilities/DriverExtensions.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ private let cachedSDKPath: Result<String, Error>? = {
5353
}
5454
// Assume that if neither of the environment variables are set, we are
5555
// using a build-tree version of the swift frontend, and so we do not set
56-
// `-sdk`. Fallthrough to return `nil`.
57-
#endif
58-
59-
#if os(macOS)
56+
// `-sdk`.
57+
return nil
58+
#elseif os(macOS)
6059
return Result {
6160
if let pathFromEnv = ProcessEnv.vars["SDKROOT"] {
6261
return pathFromEnv
@@ -79,7 +78,7 @@ private let cachedSDKPath: Result<String, Error>? = {
7978
}
8079
return path.spm_chomp()
8180
}
82-
#endif
83-
81+
#else
8482
return nil
83+
#endif
8584
}()

0 commit comments

Comments
 (0)