Advanced
Swift
Q68 / 100
What is macro expansion in Swift 5.9?
Correct! Well done.
Incorrect.
The correct answer is B) A type-safe code generation mechanism where #macroName expands to Swift code at compile time based on Syntax tree analysis
B
Correct Answer
A type-safe code generation mechanism where #macroName expands to Swift code at compile time based on Syntax tree analysis
Explanation
Swift 5.9 macros (declaration, expression, accessor) use SwiftSyntax to generate boilerplate at compile time. #Preview and @Observable use this mechanism.
Progress
68/100