mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Parameterize conformance lookup on whether "missing" conformances are allowed.
Many clients of the conformance lookup operations would prefer to get an invalid conformance (== there is no conformance) rather than a missing conformance. Parameterize the conformance lookup operations so that most callers won't see missing conformances, by filtering them out at the end. Opt-in those callers that do want to see missing conformances so they can be diagnosed.
This commit is contained in:
@@ -6225,7 +6225,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint(
|
||||
case ConstraintKind::LiteralConformsTo: {
|
||||
// Check whether this type conforms to the protocol.
|
||||
auto conformance = DC->getParentModule()->lookupConformance(
|
||||
type, protocol);
|
||||
type, protocol, /*allowMissing=*/true);
|
||||
if (conformance) {
|
||||
return recordConformance(conformance);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user