Skip to content

[ConstraintSystem] Use fallback type constraint to default pack expansion #66708

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

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 16, 2023

  • Generalizes DefaultClosureType into FallbackType constraint.

  • Binding of pack expansion types is delayed until solving but use
    of Defaultable was preventing it from being considered early
    because that constraint impacts binding set ranking, switching
    to FallbackType constraint give us better semantics where pack
    expansion type variables are going to be bound as soon as they
    have a contextual type.

Resolves: rdar://110819621

@xedin xedin requested a review from hborla as a code owner June 16, 2023 16:36
@xedin
Copy link
Contributor Author

xedin commented Jun 16, 2023

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Jun 16, 2023

@swift-ci please test source compatibility

xedin added 2 commits June 16, 2023 11:15
This constraint is useful in more places than closures because
it gives a way to provide a "fallback type" without it having
effect on inference.
…sion

Binding of pack expansion types is delayed until solving but use
of `Defaultable` was preventing it from being considered early
because that constraint impacts binding set ranking, switching
to `FallbackType` constraint give us better semantics where pack
expansion type variables are going to be bound as soon as they
have a contextual type.

Resolves: rdar://110819621
@xedin xedin force-pushed the generalize-default-closure-type-constraint branch from 4823bf2 to 83bb9c1 Compare June 16, 2023 18:15
@xedin
Copy link
Contributor Author

xedin commented Jun 16, 2023

@swift-ci please test

@xedin xedin merged commit 199616a into swiftlang:main Jun 19, 2023
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