Skip to content

Sema: Handle protocol compositions containing type variables in matchTypes() [5.1] #25555

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

Conversation

slavapestov
Copy link
Contributor

We would previously fail to match something like (C<$T1> & P) against
(C<Int> & P) when the constraint kind was <= Subtype, because we would
fall back to a type equality test in that case.

However, this was only valid for protocol compositions without superclass
constraints since the superclass could contain a type variable on one
side of the constraint.

Fix this by adding support for protocol composition types to
matchDeepEqualityTypes().

…Types()

We would previously fail to match something like (C<$T1> & P) against
(C<Int> & P) when the constraint kind was <= Subtype, because we would
fall back to a type equality test in that case.

However, this was only valid for protocol compositions without superclass
constraints since the superclass could contain a type variable on one
side of the constraint.

Fix this by adding support for protocol composition types to
matchDeepEqualityTypes().
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov merged commit e298121 into swiftlang:swift-5.1-branch Jun 18, 2019
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