Skip to content

Commit 6c4908a

Browse files
committed
Swift: Fix unavailability checks after 6.2 upgrade
1 parent 5bb740a commit 6c4908a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

swift/extractor/SwiftExtractor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ static std::unordered_set<swift::ModuleDecl*> extractDeclarations(
170170
bodyEmissionStrategy);
171171
auto topLevelDecls = getTopLevelDecls(module, primaryFile, lazyDeclaration);
172172
for (auto decl : topLevelDecls) {
173-
// TODO: Swift 6.2 is unavailable
173+
if (decl->isUnavailable()) {
174+
continue;
175+
}
174176
visitor.extract(decl);
175177
}
176178
for (auto& comment : comments) {

swift/extractor/translators/DeclTranslator.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@ void DeclTranslator::fillTypeDecl(const swift::TypeDecl& decl, codeql::TypeDecl&
292292
void DeclTranslator::fillIterableDeclContext(const swift::IterableDeclContext& decl,
293293
codeql::Decl& entry) {
294294
for (auto member : decl.getMembers()) {
295-
// TODO: Swift 6.2 unavailable members
295+
if (member->isUnavailable()) {
296+
continue;
297+
}
296298
entry.members.emplace_back(dispatcher.fetchLabel(member));
297299
}
298300
}

0 commit comments

Comments
 (0)