I noticed that String is perhaps the only "basic" type in Swift that doesn't conform to CustomStringConvertible, why is that?
It's easy to make String conform to CustomStringConvertible, but is that discouraged and if so why?
Some code to illustrate the above:
// Uncomment this extension to make String conform and thus remove the two errors below:
//extension String: CustomStringConvertible { public var description: String { return self } }
let a: CustomStringConvertible = String("Hello").utf8 // Ok (since String.UTF8View conforms to CustomStringConvertible)
let b: CustomStringConvertible = String("Hello") // Error: 'String' is not convertible to 'CustomStringConvertible'.
let c: [CustomStringConvertible.Type] = [Int.self, StaticString.self] // Ok (since Int and StaticString conforms to CustomStringConvertible)
let d: [CustomStringConvertible.Type] = [Int.self, String.self] // Error: Type 'String' does not conform to protocol 'CustomStringConvertible'.