Skip to content

[Docs] Add details for addMaterializePackExpansionConstraint #70618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/swift/Sema/Constraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ enum class ConstraintKind : char {
/// Both (first and second) pack types should have the same reduced shape.
SameShape,
/// The first type is a tuple containing a single unlabeled element that is a
/// pack expansion. The second type is that pack expansion.
/// pack expansion. The second type is its pattern type.
MaterializePackExpansion,
};

Expand Down
13 changes: 8 additions & 5 deletions include/swift/Sema/ConstraintSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -3823,14 +3823,17 @@ class ConstraintSystem {
/// Given a tuple with a single unlabeled element that represents a pack
/// expansion (either directly via \c PackExpansionType or through a type
/// variable constrained to a pack expansion), materialize the pack expansion
/// and return its pattern type as a result. The result is a type variable
/// because element of the tuple is not required to be resolved at the time of
/// the call and operation is delayed until the element is sufficiently
/// resolved (see \c simplifyMaterializePackExpansionConstraint)
/// and return its pattern type as a result. The result is a type
/// variable because element of the tuple is not required to be resolved at
/// the time of the call and operation is delayed until the element is
/// sufficiently resolved (see \c simplifyMaterializePackExpansionConstraint)
///
/// \param tupleType A tuple with a single unlabeled element that represents a
/// pack expansion.
/// pack expansion.
/// \param locator The locator.
///
/// \returns A type variable type that represents the pattern type of the pack
/// expansion.
TypeVariableType *
addMaterializePackExpansionConstraint(Type tupleType,
ConstraintLocatorBuilder locator);
Expand Down