@@ -65,6 +65,7 @@ namespace constraints {
6565class ConstraintSystem ;
6666class SyntacticElementTarget ;
6767struct PreparedOverload ;
68+ struct PreparedOverloadBuilder ;
6869
6970} // end namespace constraints
7071
@@ -2954,7 +2955,7 @@ class ConstraintSystem {
29542955 // / Create a new type variable.
29552956 TypeVariableType *createTypeVariable (ConstraintLocator *locator,
29562957 unsigned options,
2957- PreparedOverload *preparedOverload
2958+ PreparedOverloadBuilder *preparedOverload
29582959 = nullptr );
29592960
29602961 // / Retrieve the set of active type variables.
@@ -3414,7 +3415,8 @@ class ConstraintSystem {
34143415 // / Update OpenedExistentials and record a change in the trail.
34153416 void recordOpenedExistentialType (ConstraintLocator *locator,
34163417 ExistentialArchetypeType *opened,
3417- PreparedOverload *preparedOverload = nullptr );
3418+ PreparedOverloadBuilder *preparedOverload
3419+ = nullptr );
34183420
34193421 // / Retrieve the generic environment for the opened element of a given pack
34203422 // / expansion, or \c nullptr if no environment was recorded yet.
@@ -3622,7 +3624,7 @@ class ConstraintSystem {
36223624 // / Log and record the application of the fix. Return true iff any
36233625 // / subsequent solution would be worse than the best known solution.
36243626 bool recordFix (ConstraintFix *fix, unsigned impact = 1 ,
3625- PreparedOverload *preparedOverload = nullptr );
3627+ PreparedOverloadBuilder *preparedOverload = nullptr );
36263628
36273629 void recordPotentialHole (TypeVariableType *typeVar);
36283630 void recordAnyTypeVarAsPotentialHole (Type type);
@@ -3698,13 +3700,13 @@ class ConstraintSystem {
36983700 void addConstraint (ConstraintKind kind, Type first, Type second,
36993701 ConstraintLocatorBuilder locator,
37003702 bool isFavored = false ,
3701- PreparedOverload *preparedOverload = nullptr );
3703+ PreparedOverloadBuilder *preparedOverload = nullptr );
37023704
37033705 // / Add a requirement as a constraint to the constraint system.
37043706 void addConstraint (Requirement req, ConstraintLocatorBuilder locator,
37053707 bool isFavored,
37063708 bool prohibitNonisolatedConformance,
3707- PreparedOverload *preparedOverload = nullptr );
3709+ PreparedOverloadBuilder *preparedOverload = nullptr );
37083710
37093711 void addApplicationConstraint (
37103712 FunctionType *appliedFn, Type calleeType,
@@ -4319,7 +4321,7 @@ class ConstraintSystem {
43194321 Type openUnboundGenericType (GenericTypeDecl *decl, Type parentTy,
43204322 ConstraintLocatorBuilder locator,
43214323 bool isTypeResolution,
4322- PreparedOverload *preparedOverload = nullptr );
4324+ PreparedOverloadBuilder *preparedOverload = nullptr );
43234325
43244326 // / Replace placeholder types with fresh type variables, and unbound generic
43254327 // / types with bound generic types whose generic args are fresh type
@@ -4330,7 +4332,7 @@ class ConstraintSystem {
43304332 // / \returns The converted type.
43314333 Type replaceInferableTypesWithTypeVars (Type type,
43324334 ConstraintLocatorBuilder locator,
4333- PreparedOverload *preparedOverload
4335+ PreparedOverloadBuilder *preparedOverload
43344336 = nullptr );
43354337
43364338 // / "Open" the given type by replacing any occurrences of generic
@@ -4343,7 +4345,7 @@ class ConstraintSystem {
43434345 // / \returns The opened type, or \c type if there are no archetypes in it.
43444346 Type openType (Type type, ArrayRef<OpenedType> replacements,
43454347 ConstraintLocatorBuilder locator,
4346- PreparedOverload *preparedOverload);
4348+ PreparedOverloadBuilder *preparedOverload);
43474349
43484350 // / "Open" an opaque archetype type, similar to \c openType.
43494351 Type openOpaqueType (OpaqueTypeArchetypeType *type,
@@ -4360,12 +4362,12 @@ class ConstraintSystem {
43604362 Type openPackExpansionType (PackExpansionType *expansion,
43614363 ArrayRef<OpenedType> replacements,
43624364 ConstraintLocatorBuilder locator,
4363- PreparedOverload *preparedOverload);
4365+ PreparedOverloadBuilder *preparedOverload);
43644366
43654367 // / Update OpenedPackExpansionTypes and record a change in the trail.
43664368 void recordOpenedPackExpansionType (PackExpansionType *expansion,
43674369 TypeVariableType *expansionVar,
4368- PreparedOverload *preparedOverload
4370+ PreparedOverloadBuilder *preparedOverload
43694371 = nullptr );
43704372
43714373 // / Undo the above change.
@@ -4392,29 +4394,29 @@ class ConstraintSystem {
43924394 ConstraintLocatorBuilder locator,
43934395 SmallVectorImpl<OpenedType> &replacements,
43944396 DeclContext *outerDC,
4395- PreparedOverload *preparedOverload);
4397+ PreparedOverloadBuilder *preparedOverload);
43964398
43974399 // / Open the generic parameter list and its requirements,
43984400 // / creating type variables for each of the type parameters.
43994401 void openGeneric (DeclContext *outerDC,
44004402 GenericSignature signature,
44014403 ConstraintLocatorBuilder locator,
44024404 SmallVectorImpl<OpenedType> &replacements,
4403- PreparedOverload *preparedOverload);
4405+ PreparedOverloadBuilder *preparedOverload);
44044406
44054407 // / Open the generic parameter list creating type variables for each of the
44064408 // / type parameters.
44074409 void openGenericParameters (DeclContext *outerDC,
44084410 GenericSignature signature,
44094411 SmallVectorImpl<OpenedType> &replacements,
44104412 ConstraintLocatorBuilder locator,
4411- PreparedOverload *preparedOverload);
4413+ PreparedOverloadBuilder *preparedOverload);
44124414
44134415 // / Open a generic parameter into a type variable and record
44144416 // / it in \c replacements.
44154417 TypeVariableType *openGenericParameter (GenericTypeParamType *parameter,
44164418 ConstraintLocatorBuilder locator,
4417- PreparedOverload *preparedOverload);
4419+ PreparedOverloadBuilder *preparedOverload);
44184420
44194421 // / Given generic signature open its generic requirements,
44204422 // / using substitution function, and record them in the
@@ -4424,7 +4426,7 @@ class ConstraintSystem {
44244426 bool skipProtocolSelfConstraint,
44254427 ConstraintLocatorBuilder locator,
44264428 llvm::function_ref<Type(Type)> subst,
4427- PreparedOverload *preparedOverload);
4429+ PreparedOverloadBuilder *preparedOverload);
44284430
44294431 // Record the given requirement in the constraint system.
44304432 void openGenericRequirement (DeclContext *outerDC,
@@ -4434,18 +4436,18 @@ class ConstraintSystem {
44344436 bool skipProtocolSelfConstraint,
44354437 ConstraintLocatorBuilder locator,
44364438 llvm::function_ref<Type(Type)> subst,
4437- PreparedOverload *preparedOverload);
4439+ PreparedOverloadBuilder *preparedOverload);
44384440
44394441 // / Update OpenedTypes and record a change in the trail.
44404442 void recordOpenedType (
44414443 ConstraintLocator *locator, ArrayRef<OpenedType> openedTypes,
4442- PreparedOverload *preparedOverload = nullptr );
4444+ PreparedOverloadBuilder *preparedOverload = nullptr );
44434445
44444446 // / Record the set of opened types for the given locator.
44454447 void recordOpenedTypes (
44464448 ConstraintLocatorBuilder locator,
44474449 const SmallVectorImpl<OpenedType> &replacements,
4448- PreparedOverload *preparedOverload = nullptr ,
4450+ PreparedOverloadBuilder *preparedOverload = nullptr ,
44494451 bool fixmeAllowDuplicates = false );
44504452
44514453 // / Check whether the given type conforms to the given protocol and if
@@ -4458,7 +4460,7 @@ class ConstraintSystem {
44584460 FunctionType *fnType, Type baseType, ValueDecl *decl, DeclContext *dc,
44594461 unsigned numApplies, bool isMainDispatchQueue,
44604462 ArrayRef<OpenedType> replacements, ConstraintLocatorBuilder locator,
4461- PreparedOverload *preparedOverload);
4463+ PreparedOverloadBuilder *preparedOverload);
44624464
44634465 // / Retrieve the type of a reference to the given value declaration.
44644466 // /
@@ -4474,7 +4476,7 @@ class ConstraintSystem {
44744476 FunctionRefInfo functionRefInfo,
44754477 ConstraintLocatorBuilder locator,
44764478 DeclContext *useDC,
4477- PreparedOverload *preparedOverload);
4479+ PreparedOverloadBuilder *preparedOverload);
44784480
44794481 // / Return the type-of-reference of the given value.
44804482 // /
@@ -4516,7 +4518,7 @@ class ConstraintSystem {
45164518 Type baseTy, ValueDecl *decl, DeclContext *useDC, bool isDynamicLookup,
45174519 FunctionRefInfo functionRefInfo, ConstraintLocator *locator,
45184520 SmallVectorImpl<OpenedType> *replacements = nullptr ,
4519- PreparedOverload *preparedOverload = nullptr );
4521+ PreparedOverloadBuilder *preparedOverload = nullptr );
45204522
45214523 // / Retrieve a list of generic parameter types solver has "opened" (replaced
45224524 // / with a type variable) at the given location.
@@ -4936,7 +4938,11 @@ class ConstraintSystem {
49364938 prepareOverload (ConstraintLocator *locator,
49374939 OverloadChoice choice,
49384940 DeclContext *useDC,
4939- PreparedOverload *preparedOverload);
4941+ PreparedOverloadBuilder *preparedOverload);
4942+
4943+ void replayChanges (
4944+ ConstraintLocatorBuilder locator,
4945+ PreparedOverload preparedOverload);
49404946
49414947 // / Resolve the given overload set to the given choice.
49424948 void resolveOverload (ConstraintLocator *locator, Type boundType,
@@ -5351,13 +5357,13 @@ class ConstraintSystem {
53515357 ConstraintKind matchKind,
53525358 ConstraintLocator *locator,
53535359 ConstraintLocator *calleeLocator,
5354- PreparedOverload *preparedOverload = nullptr );
5360+ PreparedOverloadBuilder *preparedOverload = nullptr );
53555361
53565362 // / Used by applyPropertyWrapperToParameter() to update appliedPropertyWrappers
53575363 // / and record a change in the trail.
53585364 void applyPropertyWrapper (Expr *anchor,
53595365 AppliedPropertyWrapper applied,
5360- PreparedOverload *preparedOverload = nullptr );
5366+ PreparedOverloadBuilder *preparedOverload = nullptr );
53615367
53625368 // / Undo the above change.
53635369 void removePropertyWrapper (Expr *anchor);
0 commit comments