mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Requirement machine] Ignore unavailable conformances on superclass constraints.
When determining whether a superclass conforms to a particular protocol, skip unavailable conformances. This way, we don't minimize away a constraint that might only apply to subclasses of the specified superclass. Fixes rdar://91853658.
This commit is contained in:
@@ -631,11 +631,18 @@ public:
|
||||
/// might include "missing" conformances, which are synthesized for some
|
||||
/// protocols as an error recovery mechanism.
|
||||
///
|
||||
/// \param allowUnavailable When \c true, the resulting conformance reference
|
||||
/// might include "unavailable" conformances, meaning that the conformance
|
||||
/// cannot actually be used and will be diagnosed if used later. Pass
|
||||
/// \c false here for queries that want to determine whether the conformance
|
||||
/// is likely to be usable.
|
||||
///
|
||||
/// \returns The result of the conformance search, which will be
|
||||
/// None if the type does not conform to the protocol or contain a
|
||||
/// ProtocolConformanceRef if it does conform.
|
||||
ProtocolConformanceRef lookupConformance(Type type, ProtocolDecl *protocol,
|
||||
bool allowMissing = false);
|
||||
bool allowMissing = false,
|
||||
bool allowUnavailable = true);
|
||||
|
||||
/// Look for the conformance of the given existential type to the given
|
||||
/// protocol.
|
||||
|
||||
Reference in New Issue
Block a user