[AST] Ignore UnvalidatedDeclsWithOpaqueReturnTypes in skipped functions

This commit is contained in:
Rintaro Ishizaki
2025-03-14 06:18:10 -07:00
parent a2e40d6c31
commit f3191c8068

View File

@@ -3751,6 +3751,10 @@ void SourceFile::setAvailabilityScope(AvailabilityScope *scope) {
ArrayRef<OpaqueTypeDecl *> SourceFile::getOpaqueReturnTypeDecls() {
for (auto *vd : UnvalidatedDeclsWithOpaqueReturnTypes.takeVector()) {
if (vd->getDeclContext()->getInnermostSkippedFunctionContext()) {
// Ignore things in skipped functions.
continue;
}
if (auto opaqueDecl = vd->getOpaqueResultTypeDecl()) {
auto inserted = ValidatedOpaqueReturnTypes.insert(
{opaqueDecl->getOpaqueReturnTypeIdentifier().str(),