Skip to content
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

Implemented Proper Protocol Composition Type Parsing #1314

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

art-divin
Copy link
Collaborator

Resolves #815

Context

Currently Sourcery does not properly parse types which are declared as a combination of a class and protocol.

1 protocol P {}
2 class C {}
3 class B: C {}
4 class A: C & P {}

here in this example, type A would not have C or P in its implements, inherits, based collections.

This PR adds this possibility for accessing types if the declaration is combining them, but also, this PR removes all Class instances from implements when such combination of Class & Protocol is used in the type declaration.
This behaviour is different from how it was working before, where Class instances were put into implements after parsing ProtocolComposition, which was against the documentation and common sense.

@art-divin art-divin added this to the 2.1.9 milestone Mar 28, 2024
@art-divin art-divin self-assigned this Mar 28, 2024
@art-divin art-divin changed the title Implemented proper protocol composition parsing Implemented Proper Protocol Composition Type Parsing Mar 28, 2024
@art-divin art-divin merged commit e1993f4 into master Mar 28, 2024
2 checks passed
@art-divin art-divin deleted the fix-protocol-composition-based-inherits-implements branch March 28, 2024 19:07
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.

.inherits doesn't work with existential
1 participant