mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Skip opaque types nested in skipped function bodies
Opaque types are gathered and visited separately. As with local types, only serialize them if they are not within a skipped function body. Fixes a crash caused when compiling the primary file, where delayed parsing is explictly disabled. Resolves rdar://73167790
This commit is contained in:
@@ -5273,6 +5273,11 @@ void Serializer::writeAST(ModuleOrSourceFile DC) {
|
||||
}
|
||||
|
||||
for (auto OTD : opaqueReturnTypeDecls) {
|
||||
// FIXME: We should delay parsing function bodies so these type decls
|
||||
// don't even get added to the file.
|
||||
if (OTD->getDeclContext()->getInnermostSkippedFunctionContext())
|
||||
continue;
|
||||
|
||||
hasOpaqueReturnTypes = true;
|
||||
Mangle::ASTMangler Mangler;
|
||||
auto MangledName = Mangler.mangleOpaqueTypeDecl(OTD);
|
||||
|
||||
Reference in New Issue
Block a user