[Constraint System] Evaluable hashability during constraint generation.

This commit is contained in:
Amritpan Kaur
2025-03-03 22:55:13 -08:00
parent c059d1521d
commit 724e3f9910
3 changed files with 44 additions and 36 deletions

View File

@@ -4459,11 +4459,8 @@ public:
private:
/// Add the constraints needed to bind an overload's type variable.
void bindOverloadType(
const SelectedOverload &overload, Type boundType,
ConstraintLocator *locator, DeclContext *useDC,
llvm::function_ref<void(unsigned int, Type, ConstraintLocator *)>
verifyThatArgumentIsHashable);
void bindOverloadType(const SelectedOverload &overload, Type boundType,
ConstraintLocator *locator, DeclContext *useDC);
/// Describes a direction of optional wrapping, either increasing optionality
/// or decreasing optionality.
@@ -4940,6 +4937,12 @@ public:
Expr *buildTypeErasedExpr(Expr *expr, DeclContext *dc, Type contextualType,
ContextualTypePurpose purpose);
/// Ensures that the given argument type conforms to the `Hashable` protocol
/// and adds a conformance constraint if it does not. This is required for
/// arguments used as key path components, as they serve as lookup keys.
void verifyThatArgumentIsHashable(unsigned index, Type argType,
ConstraintLocator *locator, SourceLoc loc);
private:
/// Determines whether or not a given conversion at a given locator requires
/// the creation of a temporary value that's only valid for a limited scope.