Skip to content

Commit 3f553be

Browse files
committed
Handle unowned and unmanaged references.
1 parent c2b13cd commit 3f553be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stdlib/public/Reflection/TypeLowering.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,9 @@ class LowerType
21212121
return TC.getReferenceTypeInfo(Kind, ReferenceTI->getReferenceCounting());
21222122

21232123
if (auto *EnumTI = dyn_cast<EnumTypeInfo>(TI)) {
2124-
if (EnumTI->isOptional() && Kind == ReferenceKind::Weak) {
2124+
if (EnumTI->isOptional() &&
2125+
(Kind == ReferenceKind::Weak || Kind == ReferenceKind::Unowned ||
2126+
Kind == ReferenceKind::Unmanaged)) {
21252127
auto *TI = TC.getTypeInfo(EnumTI->getCases()[0].TR, ExternalTypeInfo);
21262128
return rebuildStorageTypeInfo(TI, Kind);
21272129
}

0 commit comments

Comments
 (0)