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

Bug in types.based (or misconception about how it should work) #180

Closed
dgattey opened this issue Mar 8, 2017 · 6 comments
Closed

Bug in types.based (or misconception about how it should work) #180

dgattey opened this issue Mar 8, 2017 · 6 comments

Comments

@dgattey
Copy link

dgattey commented Mar 8, 2017

I have a protocol called Operation. It's implemented by AdvancedOperation, and there's another class, GroupOperation that's itself a subclass of AdvancedOperation. There are then a ton of AdvancedOperation and GroupOperation subclasses.

With a template that starts with {% for type in types.based.AdvancedOperation %}, none of the GroupOperation subclasses are targeted. If I switch it to types.based.Operation, nothing at all is targeted.

This feels like a bug. Are recursive dependencies supported? As in, shouldn't I get all GroupOperation subclasses when I target AdvancedOperation? If not, why not, and can that feature be added? Alternatively, doing something like {% for type in types.based.AdvancedOperation|GroupOperation %} would work for me too, but that's also not supported.

@krzysztofzablocki
Copy link
Owner

It should work, might be a regression. If those are known types does types.implementing.AdvancedOperation work?

@dgattey
Copy link
Author

dgattey commented Mar 8, 2017

Both Advanced and Group operation are in a pod's module (whose source sourcery is indeed looking through). And the subclasses are in another pod's module. With inheriting.AdvancedOperation or implementing.AdvancedOperation, I actually get nothing at all output. Just like targeting Operation

@dgattey
Copy link
Author

dgattey commented Mar 8, 2017

Might indicate that they're not known types for some reason hmm

@krzysztofzablocki
Copy link
Owner

Are you pointing sourcery at source code that has definition of protocols or the classes implementing them? Or both?

@ilyapuchka
Copy link
Collaborator

Next week I'll work on #87 adding support for scanning multiple targets. This should solve an issue with 3rd party (pods) code

@ilyapuchka
Copy link
Collaborator

@dgattey with #193 you should be able to scan CocoaPods dependencies and avoid unknown types 🎉

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

No branches or pull requests

3 participants