[swift-dev] Optional to String conversion
atrick at apple.com
Sat Dec 5 00:00:04 CST 2015
I’m adding runtime functionality to support optional casts and ran into some Optional to String conversion behavior that is currently somewhat accidental—it will break when I add functionality. I want to understand the desired behavior before doing extra work to fix it.
Currently swift does this:
I think swift should do this:
When a value already knows how to represent itself as a string, I don't think that the string "Optional" belongs in the textual representation.
When debugging data structures, it makes sense to include the "Optional" indicator.
What was the intention here and what do people think is the desired behavior?
More information about the swift-dev