Skip to content

Commit 669acb1

Browse files
authored
Merge pull request #254 from MaxDesiatov/patch-2
Make SourceLocation and related types Hashable
2 parents c4f53d3 + ee428a2 commit 669acb1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/SwiftSyntax/SourceLocation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/// Represent the user-facing part of SourceLocation that can be calculated
1414
/// on demand.
15-
struct ComputedLocation: Codable, CustomDebugStringConvertible {
15+
struct ComputedLocation: Hashable, Codable, CustomDebugStringConvertible {
1616
/// The line in the file where this location resides. 1-based.
1717
let line: Int
1818

@@ -43,7 +43,7 @@ struct ComputedLocation: Codable, CustomDebugStringConvertible {
4343
}
4444

4545
/// Represents a source location in a Swift file.
46-
public struct SourceLocation: Codable, CustomDebugStringConvertible {
46+
public struct SourceLocation: Hashable, Codable, CustomDebugStringConvertible {
4747

4848
/// Line and column that can be computed on demand.
4949
private var compLoc: ComputedLocation?
@@ -91,7 +91,7 @@ public struct SourceLocation: Codable, CustomDebugStringConvertible {
9191
}
9292

9393
/// Represents a start and end location in a Swift file.
94-
public struct SourceRange: Codable, CustomDebugStringConvertible {
94+
public struct SourceRange: Hashable, Codable, CustomDebugStringConvertible {
9595

9696
/// The beginning location in the source range.
9797
public let start: SourceLocation

0 commit comments

Comments
 (0)