Skip to content

Conversation

@kathygray-pl
Copy link
Contributor

@kathygray-pl kathygray-pl commented Oct 31, 2025

Requirement Machine: Fix crashes on (some) pack + tuple types

Fixes issue #84490

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: For commit messages, we tend to use Foo: Bar, baz or [Foo] Bar, baz

return back().getKind() == Symbol::Kind::Shape;
}

MutableTerm Term::termWithoutShape() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be const


MutableTerm Term::termWithoutShape() {
if (hasShape())
return MutableTerm(begin(), end()-1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: we usually put spaces around operators

return back().getKind() == Symbol::Kind::Shape;
}

MutableTerm MutableTerm::termWithoutShape() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be dead?

Adding abstractions to check terms for shape symbol and remove the shape
symbol from the end of the sequence of symbols, rather than manually
manipulating the end() sequence externally.
…ashes

Support pack expansion types in term rewriting, maintaining shape invariants and not
throwing assertions unnecessarily.

Additional tests added for an inifinite case and a concrete case.
@kathygray-pl kathygray-pl force-pushed the requirementMachinePack branch from 385d7f2 to d68a7a7 Compare October 31, 2025 17:54
@kathygray-pl
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor

Please fix the PR title to be more descriptive, otherwise it looks good to go.

@kathygray-pl kathygray-pl changed the title Requirement machine pack Requirement Machine: Fix crash on pack + tuple type Nov 3, 2025
@kathygray-pl kathygray-pl merged commit feebe6a into swiftlang:main Nov 3, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants