-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make ByteBuffer.debugDescription
suitable for structural display
#2495
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes all the usefulness of debugDescription
.
Indeed and I was also quite confused about it. However, |
Ah yes, this rings a bell. The mistake was to initially add the Okay, then this PR should change to add back the actually useful |
Yes, we can do that as a follow up as described in the PR description once #2475 landed. |
Note: my recommendation that the feature that distinguishes (This comes from the investigation I did last month for apple/swift-collections#301.) FWIW, I usually call the "print everything during manual debugging" method |
I would be happy to help if I can. Do you think we should consider adding the debug description (under a new name?) in this PR, or later as a follow-up? I remember @weissi mentioned that we might rewrite Existing |
Motivation
CustomDebugStringConvertible
/debugDescription
name and documentation is confusing and should be changed but it is today expected to be suitable to be used as part of a structured display e.g. to be printed as part of anArray
s description, astruct
orenum
with associated values. Therefore it should have no unpaired parentheses, no unescaped quotes, no top-level commas and no new lines.Modifications
let
debugDescription
simply contain the same contents asdescription
. We can't remove the property or the conformance without breaking API.Results
ByteBuffer
has a proper string representation suitable for being displayed in anArray
, as the property of astruct
or an associated value of anenum
.We can add a new property/method once #2475 landed e.g.