-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SE-0408] Enable Pack Iteration #67594
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
[SE-0408] Enable Pack Iteration #67594
Conversation
4b1b8c5
to
1fcb8da
Compare
1fcb8da
to
42a4340
Compare
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.
Looks great overall, I left a few comments line.
opened element generic environments containing same-element requirements.
bf57556
to
48cb330
Compare
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.
AST/Sema changes look great to me, thank you!
@swift-ci Please smoke test |
@swift-ci please test source compatibility |
Are we fine with merging that last joint commit with this PR? Why did we need it here in the first place? |
Yes please do! It's a latent bug that manifested in one of Sima's test cases IIRC. The bug fix isn't really relevant to the PR I originally included it in (the same-element requirement PR) other than I also hit the issue in one of the test cases there. |
JumpDest loopDest = createJumpDest(S->getBody()); | ||
|
||
// Set the destinations for 'break' and 'continue'. | ||
JumpDest endDest = createJumpDest(S->getBody()); |
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.
I think loopDest
and endDest
would be far clearer as continueDest
and breakDest
for anyone yet to read this. Just an opinion.
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.
I just saw this. I think this makes a lot of sense, thank you!
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 is in fantastic shape, thank you for your work on this feature! The review discussion above is very focused in on details, targeted bug fixes (e.g. adding a diagnosis for where
clauses during constraint generation), improvements to documentation, etc, and this patch is already quite large, so I suggest landing this as is and addressing further feedback in subsequent PRs. This will help make more incremental progress, and it'll make the subsequent changes easier to review.
This pull broke the community Android CI, maybe because a host Swift compiler isn't available there and so
|
Thanks @finagolfin, I reproduced the issue locally and I'm investigating it. Here's the symbolicated stack trace:
SwiftCompilerSources currently use bootstrapping on macOS CI, so I'm not sure what the difference is, but I don't think it's related to |
Just to clarify, macOS CI uses bootstrap-with-hostlibs vs Android which is using full bootstrap, so there could possibly be a difference there. |
I filed #70328 to track this issue |
This is the implementation of this SE-0408.
What's working
Supported
for case
where
repeat
)Design
TaggedUnion
for representingForEachStmtInfo
, where it can either beSequenceIterationInfo
or the newPackIterationInfo
.CSGen
/CSApply
for handling the pack iteration case.SILGenStmt
: it handles constructing the loop from a pack expansion expression