mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Fix availability checking for macros as default arguments (#72813)
This commit is contained in:
@@ -1179,9 +1179,7 @@ ASTNode SourceFile::getMacroExpansion() const {
|
||||
if (Kind != SourceFileKind::MacroExpansion)
|
||||
return nullptr;
|
||||
|
||||
auto genInfo =
|
||||
*getASTContext().SourceMgr.getGeneratedSourceInfo(*getBufferID());
|
||||
return ASTNode::getFromOpaqueValue(genInfo.astNode);
|
||||
return getNodeInEnclosingSourceFile();
|
||||
}
|
||||
|
||||
SourceRange SourceFile::getMacroInsertionRange() const {
|
||||
@@ -1233,6 +1231,16 @@ SourceFile *SourceFile::getEnclosingSourceFile() const {
|
||||
return getParentModule()->getSourceFileContainingLocation(sourceLoc);
|
||||
}
|
||||
|
||||
ASTNode SourceFile::getNodeInEnclosingSourceFile() const {
|
||||
if (Kind != SourceFileKind::MacroExpansion &&
|
||||
Kind != SourceFileKind::DefaultArgument)
|
||||
return nullptr;
|
||||
|
||||
auto genInfo =
|
||||
*getASTContext().SourceMgr.getGeneratedSourceInfo(*getBufferID());
|
||||
return ASTNode::getFromOpaqueValue(genInfo.astNode);
|
||||
}
|
||||
|
||||
void ModuleDecl::lookupClassMember(ImportPath::Access accessPath,
|
||||
DeclName name,
|
||||
SmallVectorImpl<ValueDecl*> &results) const {
|
||||
|
||||
Reference in New Issue
Block a user