Skip to content

Commit 4176840

Browse files
committed
Incorporate feedback
1 parent a331c6a commit 4176840

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Sources/Testing/SourceAttribution/SourceLocation.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,11 @@ extension SourceLocation: Codable {
168168
private enum _CodingKeys: String, CodingKey {
169169
case fileID
170170
case filePath
171-
case _filePath
172171
case line
173172
case column
173+
174+
/// A backwards-compatible synonym of ``filePath``.
175+
case _filePath
174176
}
175177

176178
public func encode(to encoder: any Encoder) throws {
@@ -192,8 +194,8 @@ extension SourceLocation: Codable {
192194

193195
// For simplicity's sake, we won't be picky about which key contains the
194196
// file path.
195-
filePath = try container.decodeIfPresent(String.self, forKey: ._filePath)
196-
?? try container.decode(String.self, forKey: .filePath)
197+
filePath = try container.decodeIfPresent(String.self, forKey: .filePath)
198+
?? container.decode(String.self, forKey: ._filePath)
197199
}
198200
}
199201

0 commit comments

Comments
 (0)