Merge pull request #64840 from DougGregor/macro-lookup-in-types

This commit is contained in:
Doug Gregor
2023-04-02 07:23:58 -07:00
committed by GitHub
10 changed files with 215 additions and 66 deletions

View File

@@ -335,6 +335,12 @@ func testFreestandingMacroExpansion() {
}
testFreestandingMacroExpansion()
// Explicit structs to force macros to be parsed as decl.
struct ContainerOfNumberedStructs {
#bitwidthNumberedStructs("MyIntOne")
#bitwidthNumberedStructs("MyIntTwo")
}
// Avoid re-type-checking declaration macro arguments.
@freestanding(declaration)
macro freestandingWithClosure<T>(_ value: T, body: (T) -> T) = #externalMacro(module: "MacroDefinition", type: "EmptyDeclarationMacro")