Merge pull request #32 from TouchInstinct/fix/isEqual

Fix/is equal
This commit is contained in:
Alexey Gerasimov 2018-05-29 15:33:46 +03:00 committed by GitHub
commit eef236a25d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -49,11 +49,15 @@ import LeadKit
{% if (not hasGenerics) and (not fieldsHasGenericsOrNonEqutableCollections) -%}
func isEqual(to other: {{ classType }}?) -> Bool {
{% if (fields is empty) and (not hasParent) %}
return false
{% else %}
guard let other = other else {
return false
}
return{%- if hasParent %} super.isEqual(to: other){%- endif %}{%- if (fields is not empty) and hasParent %} &&{% endif %} {% include 'blocks/class/fields-equal.twig' with { fields: fields } %}
{% endif %}
}{{ "\n" }}
{%- endif %}
}