Skip to content

Commit af0433e

Browse files
authored
Merge pull request #465 from davidungar/fix-var-in-guard-not-usable
[Incremental] Fix var in guard not usable
2 parents b2db99b + 279f9bb commit af0433e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/SwiftDriver/IncrementalCompilation/IncrementalCompilationState.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,12 +655,12 @@ extension IncrementalCompilationState {
655655
/// - message: The message to emit in the remark.
656656
/// - path: If non-nil, the path of some file. If the output for an incremental job, will print out the
657657
/// source and object files.
658-
func report(_ message: String, _ path: TypedVirtualPath?) {
659-
guard let path = path,
658+
func report(_ message: String, _ pathIfGiven: TypedVirtualPath?) {
659+
guard let path = pathIfGiven,
660660
let outputFileMap = outputFileMap,
661661
let input = path.type == .swift ? path.file : outputFileMap.getInput(outputFile: path.file)
662662
else {
663-
report(message, path?.file)
663+
report(message, pathIfGiven?.file)
664664
return
665665
}
666666
let output = outputFileMap.getOutput(inputFile: path.file, outputType: .object)

Sources/SwiftDriver/IncrementalCompilation/ModuleDependencyGraphParts/DependencySource.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ extension ModuleDependencyGraph {
2828
}
2929
init(_ file: VirtualPath) {
3030
let ext = file.extension
31-
let type =
31+
let typeIfExpected =
3232
ext == FileType.swiftDeps .rawValue ? FileType.swiftDeps :
3333
ext == FileType.swiftModule.rawValue ? FileType.swiftModule
3434
: nil
35-
guard let type = type else {
35+
guard let type = typeIfExpected else {
3636
fatalError("unexpected dependencySource extension: \(String(describing: ext))")
3737
}
3838
self.init(TypedVirtualPath(file: file, type: type))

0 commit comments

Comments
 (0)