Skip to content

Commit a56c89f

Browse files
authored
[Debug] Conditional _DebugDescription macro declaration (#70351)
Make `_DebugDescription` macro conditional upon macro availability in the build. The `Macros` feature is based on the value of `SWIFT_BUILD_SWIFT_SYNTAX`. See #69626 (comment)
1 parent 91956a1 commit a56c89f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stdlib/public/core/DebuggerSupport.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
import SwiftShims
1414

15+
// Macros are disabled when Swift is built without swift-syntax.
16+
#if $Macros && hasAttribute(attached)
17+
1518
/// Converts description definitions to a debugger type summary.
1619
///
1720
/// This macro converts compatible `debugDescription` (or `description`)
@@ -42,6 +45,8 @@ public macro _DebugDescription() =
4245
public macro _DebugDescriptionProperty(_ debugIdentifier: String, _ computedProperties: [String]) =
4346
#externalMacro(module: "SwiftMacros", type: "_DebugDescriptionPropertyMacro")
4447

48+
#endif
49+
4550
#if SWIFT_ENABLE_REFLECTION
4651

4752
@frozen // namespace

0 commit comments

Comments
 (0)