Skip to content

Fixed memberwise initializers for structs with variadic-tuple properties #64575

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

Conversation

rjmccall
Copy link
Contributor

Includes the work in #64529.

rjmccall added 11 commits March 22, 2023 15:40
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
Copy link
Contributor Author

@swift-ci Please test

@htmlprogrammist
Copy link

Good job 👍

@rjmccall
Copy link
Contributor Author

@swift-ci Please smoke test macOS

@rjmccall
Copy link
Contributor Author

I do not understand what is going on with these CI failures.

@rjmccall
Copy link
Contributor Author

@swift-ci Please test

@rjmccall rjmccall merged commit a3c5e16 into swiftlang:main Mar 24, 2023
@rjmccall rjmccall deleted the variadic-memberwise-initializers branch March 24, 2023 16:24
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