Skip to content

Commit c266644

Browse files
authored
Merge pull request #70618 from simanerush/sema-docs-fix
[Docs] Add details for `addMaterializePackExpansionConstraint`
2 parents 1efcb41 + 7aa3c26 commit c266644

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

include/swift/Sema/Constraint.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ enum class ConstraintKind : char {
219219
/// Both (first and second) pack types should have the same reduced shape.
220220
SameShape,
221221
/// The first type is a tuple containing a single unlabeled element that is a
222-
/// pack expansion. The second type is that pack expansion.
222+
/// pack expansion. The second type is its pattern type.
223223
MaterializePackExpansion,
224224
};
225225

include/swift/Sema/ConstraintSystem.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3823,14 +3823,17 @@ class ConstraintSystem {
38233823
/// Given a tuple with a single unlabeled element that represents a pack
38243824
/// expansion (either directly via \c PackExpansionType or through a type
38253825
/// variable constrained to a pack expansion), materialize the pack expansion
3826-
/// and return its pattern type as a result. The result is a type variable
3827-
/// because element of the tuple is not required to be resolved at the time of
3828-
/// the call and operation is delayed until the element is sufficiently
3829-
/// resolved (see \c simplifyMaterializePackExpansionConstraint)
3826+
/// and return its pattern type as a result. The result is a type
3827+
/// variable because element of the tuple is not required to be resolved at
3828+
/// the time of the call and operation is delayed until the element is
3829+
/// sufficiently resolved (see \c simplifyMaterializePackExpansionConstraint)
38303830
///
38313831
/// \param tupleType A tuple with a single unlabeled element that represents a
3832-
/// pack expansion.
3832+
/// pack expansion.
38333833
/// \param locator The locator.
3834+
///
3835+
/// \returns A type variable type that represents the pattern type of the pack
3836+
/// expansion.
38343837
TypeVariableType *
38353838
addMaterializePackExpansionConstraint(Type tupleType,
38363839
ConstraintLocatorBuilder locator);

0 commit comments

Comments
 (0)