Skip to content

Commit 816c738

Browse files
committed
Rephrase use of 'guard let' not supported by older compilers.
'guard let X else {}' works with latest Swift compilers (such as one used in swift-driver CI) but isn't supported in some older compilres used in CI and other bots.
1 parent 9ca69cc commit 816c738

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,10 @@ extension Driver {
12671267
public mutating func run(
12681268
jobs: [Job]
12691269
) throws {
1270+
if parsedOptions.hasArgument(.v) {
1271+
try printVersion(outputStream: &stderrStream)
1272+
}
1273+
12701274
let forceResponseFiles = parsedOptions.contains(.driverForceResponseFiles)
12711275

12721276
// If we're only supposed to print the jobs, do so now.

Sources/SwiftDriver/Jobs/Planning.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,11 @@ extension Driver {
197197
throws {
198198
// If asked, add jobs to precompile module dependencies
199199
guard parsedOptions.contains(.driverExplicitModuleBuild) else { return }
200-
guard let dependencyGraph else {
200+
guard let resolvedDependencyGraph = dependencyGraph else {
201201
fatalError("Attempting to plan explicit dependency build without a dependency graph")
202202
}
203-
let modulePrebuildJobs = try generateExplicitModuleDependenciesJobs(dependencyGraph: dependencyGraph)
203+
let modulePrebuildJobs =
204+
try generateExplicitModuleDependenciesJobs(dependencyGraph: resolvedDependencyGraph)
204205
modulePrebuildJobs.forEach(addJob)
205206
}
206207

0 commit comments

Comments
 (0)