From 58c0a7ff2c9be5a0a00c2ac0a5543a9b6a4cd478 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 14 Oct 2015 08:59:19 -0400 Subject: [PATCH] Categories can be of any Hashable type. --- prototype/Doubt/Category.swift | 2 ++ prototype/Doubt/Fix.swift | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/prototype/Doubt/Category.swift b/prototype/Doubt/Category.swift index ae16e3237..3fd270997 100644 --- a/prototype/Doubt/Category.swift +++ b/prototype/Doubt/Category.swift @@ -57,5 +57,7 @@ public func < (left: Category, right: Category) -> Bool { /// A type whose values belong to a set of categories. public protocol Categorizable { + typealias Category: Hashable + var categories: Set { get } } diff --git a/prototype/Doubt/Fix.swift b/prototype/Doubt/Fix.swift index bb5a8430a..30cd9abde 100644 --- a/prototype/Doubt/Fix.swift +++ b/prototype/Doubt/Fix.swift @@ -81,7 +81,7 @@ extension Fix where A: CustomJSONConvertible { // MARK: - Categorizable extension Fix where A: Categorizable { - public var categories: Set { + public var categories: Set { switch self { case let .In(.Leaf(a)): return a.categories