You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{% for type in types.types %}
{% for variable in type.storedVariables where variable.typeName.isArray %}
{% if variable.typeName.generic.typeParameters.first.implements.SomeProtocol %}
// {{variable.name}} implements SomeProtocol
{% else %}
// {{variable.name}} does not implement SomeProtocol
{% endif %}
{% endfor %}
{% endfor %}
The output I'm looking for:
// arrayOfFoos implements SomeProtocol
// arrayOfStrings does not implement SomeProtocol
The text was updated successfully, but these errors were encountered:
If I have an array of a certain
Element
type, how can I figure out if thatElement
type implements a protocol?For example: Given this input, how can I figure out which one of these generics implement
SomeProtocol
?This doesn't seem to work:
The output I'm looking for:
The text was updated successfully, but these errors were encountered: