From 8c0d80e7839fd0da0e33046e3a69abf75e9cb8b2 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 25 Jan 2022 15:08:01 +0700 Subject: [PATCH] Remove moot conformance (#91) --- Sources/Defaults/Defaults.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sources/Defaults/Defaults.swift b/Sources/Defaults/Defaults.swift index a2d8d86..4143e7f 100644 --- a/Sources/Defaults/Defaults.swift +++ b/Sources/Defaults/Defaults.swift @@ -1,7 +1,7 @@ // MIT License © Sindre Sorhus import Foundation -public protocol DefaultsBaseKey: Defaults.AnyKey { +public protocol DefaultsBaseKey { var name: String { get } var suite: UserDefaults { get } } @@ -17,7 +17,7 @@ extension DefaultsBaseKey { public enum Defaults { public typealias BaseKey = DefaultsBaseKey - public typealias AnyKey = Keys + public typealias Keys = AnyKey public typealias Serializable = DefaultsSerializable public typealias CollectionSerializable = DefaultsCollectionSerializable public typealias SetAlgebraSerializable = DefaultsSetAlgebraSerializable @@ -26,7 +26,8 @@ public enum Defaults { public typealias Bridge = DefaultsBridge typealias CodableBridge = DefaultsCodableBridge - public class Keys: BaseKey { + // We cannot use `Key` as the container for keys because of "Static stored properties not supported in generic types". + public class AnyKey: BaseKey { public typealias Key = Defaults.Key public let name: String