From ddbe0943efaff952969508ee11507df16867b3fb Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 30 Sep 2015 15:46:21 -0400 Subject: [PATCH] Location is Equatable. --- prototype/Doubt/Location.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/prototype/Doubt/Location.swift b/prototype/Doubt/Location.swift index b1f49f395..0ee7ebea5 100644 --- a/prototype/Doubt/Location.swift +++ b/prototype/Doubt/Location.swift @@ -1,4 +1,11 @@ -public enum Location { +public enum Location: Equatable { /// A literal string, vs. range information. case Literal(String) } + +public func == (left: Location, right: Location) -> Bool { + switch (left, right) { + case let (.Literal(s1), .Literal(s2)): + return s1 == s2 + } +}