-
-
Notifications
You must be signed in to change notification settings - Fork 618
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
Add implements
and inherits
properties to type
#42
Comments
I'll add it 👍 |
This will be needed for the following to work properly: protocol AutoEquatable {}
struct AStruct: Equatable {
public static func == (l: AStruct, r: AStruct) -> Bool {
return true
}
}
struct Book: AutoEquatable {
let aStruct: AStruct
} Given template like {% for type in types.implementing.AutoEquatable %}
{% for variable in type.storedVariables %}
{% if variable.type.inheritedTypes.AutoEquatable %}
{{ variable.type }}
{% endif %}
{% endfor %}
{% endfor %} It should not generate code |
Ah, so if |
well right now we don't store real types in inheritedTypes, and I think we want to because with flattening types it will be much more reliable right? |
We may store them like |
Implemneted in 0.4.1 |
As now we have a separation between
implementing
andinheriting
types collections in generator we may as well add corresponding properties toType
model.Then
inheritedTypes
(should be renamed tobased
probably?) becomes analogous totypes.based
,implements
totypes.implementing
andinherits
totypes.inheriting
.With that instead of
variable.type.inheritedTypes.MyProtocol
it will be possible to dovariable.type.implements.MyProtocol
which just reads better. Also it will be more consistent with mentioned separation of inheriting and implementing types in generator.The text was updated successfully, but these errors were encountered: