[swift-dev] [stdlib] Array.description calls debugDescription on its contents
wczekalski at me.com
Sun Dec 13 14:43:38 CST 2015
I agree with Brent that offering description on Arrays where it "shouldn't be presented to the user in raw form, ever, so the use case here is debugging” is misleading. Is there any specific reason for them to offer it? Also, there is a slightly difference in representation of description and debugDescription for ContiguousArray and ArraySlice. If the motivation behind it is unclear it might be worth to remove either the difference in implementation or the conformance to CustomStringConvertible altogether.
> Wiadomość napisana przez Dave Abrahams via swift-dev <swift-dev at swift.org> w dniu 12.12.2015, o godz. 21:41:
> Sent from my moss-covered three-handled family gradunza
>> On Dec 12, 2015, at 9:09 AM, Brent Royal-Gordon via swift-dev <swift-dev at swift.org> wrote:
>> It would similarly be nice if String.init(_: Any) were instead String.init(_: CustomStringConvertible), and passing something to it that wasn’t convertible was an error.
> Why would that be nice? It is an explicit goal that every type can be represented as a string, whatever its conformance a, FWIW
> swift-dev mailing list
> swift-dev at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-dev