Skip to content

Commit ea901d2

Browse files
author
Harlan Haskins
committed
[Serialization] Make sure to emit an XREF before XREF_OPAQUE_RETURN_TYPE_PATH_PIECE
We might have an opaque return type path piece after a generic type param type, so make sure to emit the XREF entry before the opaque return type path piece as well. Fixes rdar://53958358
1 parent bfbbdc0 commit ea901d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Serialization/Serialization.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,6 +1731,8 @@ void Serializer::writeCrossReference(const DeclContext *DC, uint32_t pathLen) {
17311731
case DeclContextKind::GenericTypeDecl: {
17321732
auto generic = cast<GenericTypeDecl>(DC);
17331733

1734+
writeCrossReference(DC->getParent(), pathLen + 1);
1735+
17341736
// Opaque return types are unnamed and need a special xref.
17351737
if (auto opaque = dyn_cast<OpaqueTypeDecl>(generic)) {
17361738
if (!opaque->hasName()) {
@@ -1744,8 +1746,6 @@ void Serializer::writeCrossReference(const DeclContext *DC, uint32_t pathLen) {
17441746
}
17451747

17461748
assert(generic->hasName());
1747-
1748-
writeCrossReference(DC->getParent(), pathLen + 1);
17491749

17501750
abbrCode = DeclTypeAbbrCodes[XRefTypePathPieceLayout::Code];
17511751

0 commit comments

Comments
 (0)