You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Debug] Accept _debugDescription in DebugDescriptionMacro (#70728)
Some data types cannot modify their `description` or `debugDescription` properties, as
modification to those properties could result in breakage to their users. To support
these conditions, `DebugDescriptionMacro` should support and prioritize an independent
property (one that that is not being reused).
This change adds support for `_debugDescription`. The macro will now prioritize the
description properties in this order:
1. `_debugDescription`
2. `debugDescription`
3. `debugDescription`
rdar://120498021
// CHECK: /* "main.MyStruct2" */ 15 as UInt8, 109 as UInt8, 97 as UInt8, 105 as UInt8, 110 as UInt8, 46 as UInt8, 77 as UInt8, 121 as UInt8, 83 as UInt8, 116 as UInt8, 114 as UInt8, 117 as UInt8, 99 as UInt8, 116 as UInt8, 50 as UInt8, 0 as UInt8,
26
-
// CHECK: /* "thirty" */ 7 as UInt8, 116 as UInt8, 104 as UInt8, 105 as UInt8, 114 as UInt8, 116 as UInt8, 121 as UInt8, 0 as UInt8
27
+
// CHECK: /* "eleven" */ 7 as UInt8, 101 as UInt8, 108 as UInt8, 101 as UInt8, 118 as UInt8, 101 as UInt8, 110 as UInt8, 0 as UInt8
27
28
// CHECK: )
28
29
30
+
@_DebugDescription
31
+
structMyStruct3:CustomDebugStringConvertible{
32
+
vardescription:String{"thirty"}
33
+
vardebugDescription:String{"eleven"}
34
+
var_debugDescription:String{"two"}
35
+
}
36
+
// CHECK: static let _lldb_summary = (
37
+
// CHECK: /* version */ 1 as UInt8,
38
+
// CHECK: /* record size */ 21 as UInt8,
39
+
// CHECK: /* "main.MyStruct3" */ 15 as UInt8, 109 as UInt8, 97 as UInt8, 105 as UInt8, 110 as UInt8, 46 as UInt8, 77 as UInt8, 121 as UInt8, 83 as UInt8, 116 as UInt8, 114 as UInt8, 117 as UInt8, 99 as UInt8, 116 as UInt8, 51 as UInt8, 0 as UInt8,
40
+
// CHECK: /* "two" */ 4 as UInt8, 116 as UInt8, 119 as UInt8, 111 as UInt8, 0 as UInt8
0 commit comments