Skip to content

Commit cdb46f7

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 b8f4481 commit cdb46f7

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
@@ -1947,6 +1947,8 @@ void Serializer::writeCrossReference(const DeclContext *DC, uint32_t pathLen) {
19471947
case DeclContextKind::GenericTypeDecl: {
19481948
auto generic = cast<GenericTypeDecl>(DC);
19491949

1950+
writeCrossReference(DC->getParent(), pathLen + 1);
1951+
19501952
// Opaque return types are unnamed and need a special xref.
19511953
if (auto opaque = dyn_cast<OpaqueTypeDecl>(generic)) {
19521954
if (!opaque->hasName()) {
@@ -1960,8 +1962,6 @@ void Serializer::writeCrossReference(const DeclContext *DC, uint32_t pathLen) {
19601962
}
19611963

19621964
assert(generic->hasName());
1963-
1964-
writeCrossReference(DC->getParent(), pathLen + 1);
19651965

19661966
abbrCode = DeclTypeAbbrCodes[XRefTypePathPieceLayout::Code];
19671967

0 commit comments

Comments
 (0)