CustomStringConvertible and TextOutputStreamable

Several parts of String use CustomStringConvertible and TextOutputStreamable conformances interchangeably, which sort of implies that we expect TextOutputStreamable to generate the same content as CustomStringConvertible. Is this an intended part of the design? Would it make sense to have TextOutputStreamable refine CustomStringConvertible, providing a default implementation of description which writes self into an empty string?

This would slightly clean up some overloads in String; I’m just not sure whether it’s correct or not.

1 Like