Skip to content

A bunch of fixes for variadic tuple properties in structs #64529

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 7 commits into from
Mar 23, 2023

Conversation

rjmccall
Copy link
Contributor

Builds on #64517.

@rjmccall
Copy link
Contributor Author

@swift-ci Please test

@rjmccall
Copy link
Contributor Author

@swift-ci Please smoke test macOS

1 similar comment
@rjmccall
Copy link
Contributor Author

@swift-ci Please smoke test macOS

whichever case it happens to be in.

This is a basic fix so that parallel walks on tuples and function
types in the substituted type will work .  Separately, though, I
do not think the places that use this really need to be passed an
orig type; this is used for computing type properties, and I am
not aware of any reason we should need an orig type to compute
type properties.  Additionally, the orig types computed by this
function are not really correct because of the substitution being
done in some cases, so it'd be very nice to rip this all out.
I'm not good to look into that right now, though.
needs to be lowered, use an opaque abstraction pattern.

As I argue in the comment, we know that the orig type is now either
an opaque type or a type with high-level structure that is invariant
to lowering.  Substitution will not change the latter property, and
an opaque abstraction pattern is correct for the former.  Attempting
to create a "truer" abstraction pattern that preserves more structure
from the orig type is both pointless and problematic.  The
substitutions we just did may have replaced pack references with
non-pack types if there are active expansions in progress; this cannot
be easily explained in terms of substitutions.  (In theory, we could
pass a more opaque concept of substitutions through AbstractionPattern,
which might help with this.  That would also make it harder to catch
bugs with signature mismatches, though.)
My original test case here used a memberwise initializer, but those
use their own logic for binding and forward parameters which will
need to be updated separately.
@rjmccall rjmccall force-pushed the variadic-tuples-in-structs branch from 46e5519 to c032cc5 Compare March 22, 2023 19:40
@rjmccall
Copy link
Contributor Author

@swift-ci Please test

@rjmccall
Copy link
Contributor Author

@swift-ci Please smoke test macOS

@rjmccall
Copy link
Contributor Author

@swift-ci Please smoke test

@rjmccall
Copy link
Contributor Author

@swift-ci Please test

@rjmccall
Copy link
Contributor Author

I think I spent an entire day not being able to land this PR despite it never breaking anything itself.

@rjmccall
Copy link
Contributor Author

@swift-ci Please smoke test

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.

1 participant