File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -4286,13 +4286,16 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
4286
4286
if (fnDecl->hasDynamicSelfResult ()) {
4287
4287
auto anyObjectTy = C.getAnyObjectType ();
4288
4288
for (auto &result : results) {
4289
- auto newResultTy =
4289
+ auto resultTy =
4290
4290
result
4291
4291
.getReturnValueType (F.getModule (), methodTy,
4292
- F.getTypeExpansionContext ())
4293
- ->replaceCovariantResultType (anyObjectTy, 0 );
4294
- result = SILResultInfo (newResultTy->getCanonicalType (),
4295
- result.getConvention ());
4292
+ F.getTypeExpansionContext ());
4293
+ if (resultTy->getOptionalObjectType ())
4294
+ resultTy = OptionalType::get (anyObjectTy)->getCanonicalType ();
4295
+ else
4296
+ resultTy = anyObjectTy;
4297
+
4298
+ result = SILResultInfo (resultTy, result.getConvention ());
4296
4299
}
4297
4300
}
4298
4301
}
You can’t perform that action at this time.
0 commit comments