diff --git a/Swift/Class.swift.twig b/Swift/Class.swift.twig index d4ab617..0da1dd9 100644 --- a/Swift/Class.swift.twig +++ b/Swift/Class.swift.twig @@ -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 %} }