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> {
42864286 if (fnDecl->hasDynamicSelfResult ()) {
42874287 auto anyObjectTy = C.getAnyObjectType ();
42884288 for (auto &result : results) {
4289- auto newResultTy =
4289+ auto resultTy =
42904290 result
42914291 .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 ());
42964299 }
42974300 }
42984301 }
You can’t perform that action at this time.
0 commit comments