-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Requirement Machine: Fix crash on pack + tuple type #85235
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
Requirement Machine: Fix crash on pack + tuple type #85235
Conversation
slavapestov
left a comment
There was a problem hiding this 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
lib/AST/RequirementMachine/Term.cpp
Outdated
| return back().getKind() == Symbol::Kind::Shape; | ||
| } | ||
|
|
||
| MutableTerm Term::termWithoutShape() { |
There was a problem hiding this comment.
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
lib/AST/RequirementMachine/Term.cpp
Outdated
|
|
||
| MutableTerm Term::termWithoutShape() { | ||
| if (hasShape()) | ||
| return MutableTerm(begin(), end()-1); |
There was a problem hiding this comment.
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
lib/AST/RequirementMachine/Term.cpp
Outdated
| return back().getKind() == Symbol::Kind::Shape; | ||
| } | ||
|
|
||
| MutableTerm MutableTerm::termWithoutShape() { |
There was a problem hiding this comment.
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.
385d7f2 to
d68a7a7
Compare
|
@swift-ci Please smoke test |
|
Please fix the PR title to be more descriptive, otherwise it looks good to go. |
Requirement Machine: Fix crashes on (some) pack + tuple types
Fixes issue #84490