Repository: apple/swift
File: include/swift/Sema/ConstraintSystem.h (C/C++)

Code before:
// }
bool isAutoClosureArgument(Expr *argExpr);

/// Checks whether referencing the given overload choice results in the self
/// parameter being applied, meaning that it's dropped from the type of the
/// reference.
bool hasAppliedSelf(ConstraintSystem &cs, const OverloadChoice &choice);
bool hasAppliedSelf(const Solution &S, const OverloadChoice &choice);
bool hasAppliedSelf(const OverloadChoice &choice,
                    llvm::function_ref<Type(Type)> getFixedType);

/// Check whether given type conforms to `RawRepresentable` protocol
/// and return witness type.
Type isRawRepresentable(ConstraintSystem &cs, Type type);

/// Compute the type that shall stand in for dynamic 'Self' in a member
/// reference with a base of the given object type.
///
/// \param memberLocator The locator of the member constraint; used to retrieve
/// the expression that the locator is anchored to.
Type getDynamicSelfReplacementType(Type baseObjTy, const ValueDecl *member,
                                   ConstraintLocator *memberLocator);

ValueDecl *getOverloadChoiceDecl(Constraint *choice);

/// Determine whether this type is considered `Sendable` when cpatured
/// i.e. a base type of a partially applied member reference.
///
/// The requirement here is more strict than regular `Sendable` conformance:
///  - The type has to conform to `Sendable`;
///  - All referenced type parameters have to conform to `SendableMetatype`.
///
/// This function requires the type to be fully resolved.
bool isSendableCapture(Type type);

/// Find any references to external type variables used in the body of a
/// conjunction element (e.g closures, taps, if/switch expressions).
///
/// This includes:
/// - Not yet resolved outer VarDecls (including closure parameters)
/// - Outer pack expansions that are not yet fully resolved
/// - Return statements with a contextual type that has not yet been resolved
///
/// This is required because isolated conjunctions, just like single-expression
/// closures, have to be connected to type variables they are going to use,
/// otherwise they'll get placed in a separate solver component and would never
/// produce a solution.
class TypeVarRefCollector : public ASTWalker {
  ConstraintSystem &CS;
  DeclContext *DC;
  ConstraintLocator *Locator;

Review comment (suggestion):
```suggestion
/// Determine whether this type is considered `Sendable` when captured
```

Code after:
// }
bool isAutoClosureArgument(Expr *argExpr);

/// Checks whether referencing the given overload choice results in the self
/// parameter being applied, meaning that it's dropped from the type of the
/// reference.
bool hasAppliedSelf(ConstraintSystem &cs, const OverloadChoice &choice);
bool hasAppliedSelf(const Solution &S, const OverloadChoice &choice);
bool hasAppliedSelf(const OverloadChoice &choice,
                    llvm::function_ref<Type(Type)> getFixedType);

/// Check whether given type conforms to `RawRepresentable` protocol
/// and return witness type.
Type isRawRepresentable(ConstraintSystem &cs, Type type);

/// Compute the type that shall stand in for dynamic 'Self' in a member
/// reference with a base of the given object type.
///
/// \param memberLocator The locator of the member constraint; used to retrieve
/// the expression that the locator is anchored to.
Type getDynamicSelfReplacementType(Type baseObjTy, const ValueDecl *member,
                                   ConstraintLocator *memberLocator);

ValueDecl *getOverloadChoiceDecl(Constraint *choice);

/// Determine whether this type is considered `Sendable` when captured
/// i.e. a base type of a partially applied member reference.
///
/// The requirement here is more strict than regular `Sendable` conformance:
///  - The type has to conform to `Sendable`;
///  - All referenced type parameters have to conform to `SendableMetatype`.
///
/// This function requires the type to be fully resolved.
bool isSendableCapture(Type type);

/// Find any references to external type variables used in the body of a
/// conjunction element (e.g closures, taps, if/switch expressions).
///
/// This includes:
/// - Not yet resolved outer VarDecls (including closure parameters)
/// - Outer pack expansions that are not yet fully resolved
/// - Return statements with a contextual type that has not yet been resolved
///
/// This is required because isolated conjunctions, just like single-expression
/// closures, have to be connected to type variables they are going to use,
/// otherwise they'll get placed in a separate solver component and would never
/// produce a solution.
class TypeVarRefCollector : public ASTWalker {
  ConstraintSystem &CS;
  DeclContext *DC;
  ConstraintLocator *Locator;