mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Narrow the filtering of unavailable conformances to Sendable only
Remove the allowUnavailable parameter to lookupConformance(), and instead explicitly check the result for hasUnavailableConformance() in the places where we used to pass 'false'. Also, narrow down this check in those places to the Sendable protocol only, fixing a regression with Hashable conformance synthesis. Fixes rdar://problem/94460143.
This commit is contained in:
@@ -640,18 +640,11 @@ 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 allowUnavailable = true);
|
||||
bool allowMissing = false);
|
||||
|
||||
/// Look for the conformance of the given existential type to the given
|
||||
/// protocol.
|
||||
|
||||
Reference in New Issue
Block a user