Skip to content

AST: Fix TypeBase::hasSimpleTypeRepr() for ProtocolCompositionType #79647

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 1 commit into from
Feb 27, 2025

Conversation

slavapestov
Copy link
Contributor

Prior to the introduction of noncopyable generics, a ProtocolCompositionType was 'simple' if it was exactly 'Any' or 'AnyObject'. Now, there is a new simple case, where we have a single inverse requirement '~Copyable' or '~Escapable', and the old logic was never updated to account for this possibility. Instead, it would ignore inverses, so it would claim that a composition like P & ~Copyable was simple when it shouldn't be.

Fixes rdar://139465298.

Prior to the introduction of noncopyable generics, a ProtocolCompositionType
was 'simple' if it was exactly 'Any' or 'AnyObject'. Now, there is a new
simple case, where we have a single inverse requirement '~Copyable' or
'~Escapable', and the old logic was never updated to account for this
possibility. Instead, it would ignore inverses, so it would claim that
a composition like `P & ~Copyable` was simple when it shouldn't be.

Fixes rdar://139465298.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

lorentey added a commit to lorentey/swift that referenced this pull request Feb 27, 2025
With Slava’s fix in swiftlang#79647, we can now refer to generalized type existentials in ABI stable code.
@slavapestov slavapestov merged commit fa86097 into swiftlang:main Feb 27, 2025
3 checks passed
lorentey added a commit to lorentey/swift that referenced this pull request Feb 28, 2025
With Slava’s fix in swiftlang#79647, we can now refer to generalized type existentials in ABI stable code.
lorentey added a commit to lorentey/swift that referenced this pull request Mar 14, 2025
With Slava’s fix in swiftlang#79647, we can now refer to generalized type existentials in ABI stable code.
lorentey added a commit to lorentey/swift that referenced this pull request Mar 18, 2025
With Slava’s fix in swiftlang#79647, we can now refer to generalized type existentials in ABI stable code.
lorentey added a commit to lorentey/swift that referenced this pull request Mar 21, 2025
With Slava’s fix in swiftlang#79647, we can now refer to generalized type existentials in ABI stable code.
lorentey added a commit to lorentey/swift that referenced this pull request Mar 26, 2025
With Slava’s fix in swiftlang#79647, we can now refer to generalized type existentials in ABI stable code.
lorentey added a commit to lorentey/swift that referenced this pull request Mar 26, 2025
With Slava’s fix in swiftlang#79647, we can now refer to generalized type existentials in ABI stable code.
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