Skip to content

Commit

Permalink
AbstractKotlinCodegen: only prefer parent property if property is enum
Browse files Browse the repository at this point in the history
* This is done because enums can't have inheritance. In all other cases, the child property should be preferred
  • Loading branch information
Thecrazyskull committed Sep 2, 2020
1 parent 5b5d8d5 commit d797b6e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,8 @@ private CodegenModel reconcileProperties(CodegenModel codegenModel,
Iterator<CodegenProperty> iterator = codegenProperties.iterator();
while (iterator.hasNext()) {
CodegenProperty codegenProperty = iterator.next();
if (codegenProperty.baseName.equals(parentModelCodegenProperty.baseName)) {
if (codegenProperty.baseName.equals(parentModelCodegenProperty.baseName)
&& parentModelCodegenProperty.isEnum) {
// We found a property in the child class that is
// a duplicate of the one in the parent,
// so mark it as inherited & copy the data type.
Expand Down

0 comments on commit d797b6e

Please sign in to comment.