Sourcery icon indicating copy to clipboard operation
Sourcery copied to clipboard

Sourcery can't find classes inheriting from a generic class

Open BenoitCaron opened this issue 5 years ago • 0 comments

Hi, I'm attempting to list all the UIViewControllers of an app. Using the following stencil and sample classes, I managed to get some of them, but I'm am facing some limitations.

I am using the latest sourcery version as of now (0.17.0).

let sourceryClasses =
[{% for type in types.based.UIViewController %}
    "{{type.name}}"{% if not forloop.last %},{% endif %}
{% endfor %}
]
class BaseViewController: UIViewController { }
class SubclassedBaseViewController: BaseViewController { }
class GenericBaseViewController<T: Equatable>: UIViewController { }
class SubclassedGenericBaseViewController: GenericBaseViewController<String> { }

The result here is

let sourceryClasses =
[
    "BaseViewController",
    "GenericBaseViewController",
    "SubclassedBaseViewController"
]

As you can see, the last class is missing. How come?

BenoitCaron avatar Feb 24 '20 14:02 BenoitCaron