@swift-ci smoke test
117 | 117 | // requirements were satisfied. | |
118 | if (checkConformance(source, TargetProtocol)) | ||
118 | if (auto conformance = checkConformance(source, TargetProtocol)) { | ||
119 | if (conformance.isConcrete()) { | ||
120 | if (!matchesActorIsolation(conformance.getConcrete(), function)) | ||
121 | return DynamicCastFeasibility::MaySucceed; |
You also need to check whether any conditional requirements have been satisfied by isolated conformances here. ProtocolConformanceRef::forEachIsolatedConformance
knows how to enumerate all of the isolated conformances, including those satisfying conditional requirements. You could build on that determine the isolation of a given ProtocolConformanceRef
and use that instead of the isConcrete check.
881 | 888 | return DynamicCastFeasibility::WillFail; | |
882 | 889 | } | |
883 | 890 | ||
891 | bool swift::matchesActorIsolation(ProtocolConformance *conformance, SILFunction *inFunction) { |
Per the previous comment, I recommend passing a ProtocolConformanceRef
in here so the callers don't do the isConcrete/getConcrete dance.
@swift-ci smoke test
Looks great with these changes
@swift-ci smoke test
Login to write a write a comment.
Check the isolation of conformances to avoid wrong folding of dynamic casts
rdar://147417762