mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Macros] Turn Macro into a declaration node.
Although the declaration of macros doesn't appear in Swift source code that uses macros, they still operate as declarations within the language. Rework `Macro` as `MacroDecl`, a generic value declaration, which appropriate models its place in the language. The vast majority of this change is in extending all of the various switches on declaration kinds to account for macros.
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
#include "TypeChecker.h"
|
||||
#include "swift/AST/GenericEnvironment.h"
|
||||
#include "swift/AST/Initializer.h"
|
||||
#include "swift/AST/Macro.h"
|
||||
#include "swift/AST/ParameterList.h"
|
||||
#include "swift/AST/ProtocolConformance.h"
|
||||
#include "swift/AST/TypeCheckRequests.h"
|
||||
@@ -2485,10 +2484,10 @@ Type ConstraintSystem::getTypeOfMacroReference(Identifier macroName,
|
||||
|
||||
// Open any the generic types.
|
||||
OpenedTypeMap replacements;
|
||||
openGeneric(macro->owningModule, macro->genericSignature,
|
||||
openGeneric(macro->getParentModule(), macro->getGenericSignature(),
|
||||
getConstraintLocator(anchor), replacements);
|
||||
|
||||
return openType(macro->signature, replacements);
|
||||
return openType(macro->getInterfaceType(), replacements);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user