Skip to content

[Debug] Rename DebugDescription fallback property to lldbDescription #75289

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ extension _DebugDescriptionPropertyMacro: PeerMacro {

/// The names of properties that can be converted to LLDB type summaries, in priority order.
fileprivate let DESCRIPTION_PROPERTIES = [
"_debugDescription",
"lldbDescription",
"debugDescription",
"description",
]
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/core/DebuggerSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ import SwiftShims
/// }
///
/// The `DebugDescription` macro supports both `debugDescription`, `description`,
/// as well as a third option: a property named `_debugDescription`. The first
/// as well as a third option: a property named `lldbDescription`. The first
/// two are implemented when conforming to the `CustomDebugStringConvertible`
/// and `CustomStringConvertible` protocols. The additional `_debugDescription`
/// and `CustomStringConvertible` protocols. The additional `lldbDescription`
/// property is useful when both `debugDescription` and `description` are
/// implemented, but don't meet the requirements of the `DebugDescription`
/// macro. If `_debugDescription` is implemented, `DebugDescription` choose it
/// macro. If `lldbDescription` is implemented, `DebugDescription` choose it
/// over `debugDescription` and `description`. Likewise, `debugDescription` is
/// preferred over `description`.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#if !$Embedded
@DebugDescription
extension ObjectIdentifier {
var _debugDescription: String {
var lldbDescription: String {
return "ObjectIdentifier(\(_value))"
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/Macros/DebugDescription/supported_description.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct MyStruct2: CustomDebugStringConvertible {
struct MyStruct3: CustomDebugStringConvertible {
var description: String { "thirty" }
var debugDescription: String { "eleven" }
var _debugDescription: String { "two" }
var lldbDescription: String { "two" }
}
// CHECK: static let _lldb_summary = (
// CHECK: /* version */ 1 as UInt8,
Expand Down