Skip to content

Commit 1204c82

Browse files
committed
[squash this] Simplify weak/unowned handling
1 parent a0a629f commit 1204c82

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/Sema/DerivedConformanceCodable.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -529,13 +529,8 @@ lookupVarDeclForCodingKeysCase(DeclContext *conformanceDC,
529529
if (!vd->isStatic()) {
530530
// This is the VarDecl we're looking for.
531531

532-
auto varType = conformanceDC->mapTypeIntoContext(vd->getInterfaceType());
533-
534-
if (auto referenceType = varType->getAs<ReferenceStorageType>()) {
535-
// This is a weak/unowned/unmanaged var. Get the inner type before
536-
// checking optionality.
537-
varType = referenceType->getReferentType();
538-
}
532+
auto varType =
533+
conformanceDC->mapTypeIntoContext(vd->getValueInterfaceType());
539534

540535
bool useIfPresentVariant =
541536
varType->getAnyNominal() == C.getOptionalDecl();

0 commit comments

Comments
 (0)