Skip to content

Allow existential parameterized compositions: any P<A> & Q #76705

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

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Sep 25, 2024

We originally didn't implement support for compositions of the form any P<A> & Q, but users discovered that we would accept this if you defined a typealias, like typealias Alias = P<A> & Q and then wrote any Alias. However, of course this didn't alway behave correctly, hence the bug reports.

Over time, I fixed most of the underlying problems that prevented this from working. The last missing piece was the ASTDemangler support for such types. Now that this is place, I think it's safe to lift this restriction.

@slavapestov slavapestov force-pushed the existential-parameterized-composition branch from 4fcf025 to c733692 Compare September 25, 2024 18:49
@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@rjmccall
Copy link
Contributor

rjmccall commented Sep 25, 2024

This needs evolution approval, right?

EDIT: no, it looks like SE-0353 meant to include this capability

@GeorgeElsham
Copy link

@slavapestov any ideas when this may be merged in? Thank you!

@slavapestov slavapestov force-pushed the existential-parameterized-composition branch from c733692 to 4f2d69c Compare May 22, 2025 22:11
@slavapestov slavapestov force-pushed the existential-parameterized-composition branch from 4f2d69c to 6241afa Compare May 22, 2025 22:13
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov enabled auto-merge May 23, 2025 18:29
auto-merge was automatically disabled May 23, 2025 18:33

Pull Request is not mergeable

@slavapestov slavapestov force-pushed the existential-parameterized-composition branch 2 times, most recently from 1fa9afc to 7c4564c Compare May 23, 2025 20:33
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov enabled auto-merge May 23, 2025 21:38
@slavapestov slavapestov merged commit 52f5453 into swiftlang:main May 24, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants