File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public typealias Codable = Encodable & Decodable
47
47
//===----------------------------------------------------------------------===//
48
48
49
49
/// A type that can be used as a key for encoding and decoding.
50
- public protocol CodingKey {
50
+ public protocol CodingKey : CustomStringConvertible {
51
51
/// The string to use in a named collection (e.g. a string-keyed dictionary).
52
52
var stringValue : String { get }
53
53
@@ -67,6 +67,12 @@ public protocol CodingKey {
67
67
init ? ( intValue: Int )
68
68
}
69
69
70
+ extension CodingKey {
71
+ public var description : String {
72
+ return stringValue
73
+ }
74
+ }
75
+
70
76
//===----------------------------------------------------------------------===//
71
77
// Encoder & Decoder
72
78
//===----------------------------------------------------------------------===//
You can’t perform that action at this time.
0 commit comments