mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
Sema: Narrow down the skipProtocolSelfConstraint hack
We actually have to check this constraint, otherwise we accept invalid code where we're referencing a protocol requirement with a concrete base type which conditionally conforms to the protocol, but the conditional requirements are unsatisfied. However, we still need to skip it for AnyObject lookup, Distributed Actors, and some weird edge case in conformance checking for isolated conformances. We should clean this up further later, but for now this closes a soundness hole. Fixes rdar://168129757.
This commit is contained in:
@@ -3472,7 +3472,7 @@ void OpenGenericTypeRequirements::operator()(GenericTypeDecl *decl,
|
||||
auto openType = [&](Type ty) -> Type {
|
||||
return cs.openType(ty, replacements, locator, preparedOverload);
|
||||
};
|
||||
cs.openGenericRequirements(outerDC, sig, /*skipProtocolSelf*/ false, locator,
|
||||
cs.openGenericRequirements(outerDC, sig, /*skipProtocolSelfConstraint=*/false, locator,
|
||||
openType, preparedOverload);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user