@@ -865,15 +865,17 @@ static void destructureYieldsForCoroutine(SILModule &M,
865
865
.getReferenceStorageReferentType ();
866
866
867
867
auto storage = accessor->getStorage ();
868
- auto valueType = storage->getValueInterfaceType ()
869
- ->getReferenceStorageReferent ();
868
+ auto valueType = storage->getValueInterfaceType ();
870
869
if (reqtSubs) {
871
870
valueType = valueType.subst (*reqtSubs);
872
871
}
873
872
873
+ auto canValueType = valueType->getCanonicalType (
874
+ accessor->getGenericSignature ());
875
+
874
876
// 'modify' yields an inout of the target type.
875
877
if (accessor->getAccessorKind () == AccessorKind::Modify) {
876
- auto loweredValueTy = M.Types .getLoweredType (origType, valueType );
878
+ auto loweredValueTy = M.Types .getLoweredType (origType, canValueType );
877
879
yields.push_back (SILYieldInfo (loweredValueTy.getASTType (),
878
880
ParameterConvention::Indirect_Inout));
879
881
return ;
@@ -882,8 +884,7 @@ static void destructureYieldsForCoroutine(SILModule &M,
882
884
// 'read' yields a borrowed value of the target type, destructuring
883
885
// tuples as necessary.
884
886
assert (accessor->getAccessorKind () == AccessorKind::Read);
885
- destructureYieldsForReadAccessor (M, origType, valueType->getCanonicalType (),
886
- yields);
887
+ destructureYieldsForReadAccessor (M, origType, canValueType, yields);
887
888
}
888
889
889
890
// / Create the appropriate SIL function type for the given formal type
0 commit comments