Append reserved swift enum type with "Enum"

This commit is contained in:
Yonas Kolb 2016-04-18 15:24:37 +10:00
parent c375f2fed5
commit 3de7a4ba85

View File

@ -337,7 +337,7 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig {
// Swift compiler will generate an error // Swift compiler will generate an error
if (isReservedWord(codegenProperty.datatypeWithEnum) || if (isReservedWord(codegenProperty.datatypeWithEnum) ||
name.equals(codegenProperty.datatypeWithEnum)) { name.equals(codegenProperty.datatypeWithEnum)) {
codegenProperty.datatypeWithEnum = escapeReservedWord(codegenProperty.datatypeWithEnum); codegenProperty.datatypeWithEnum = codegenProperty.datatypeWithEnum + "Enum";
} }
} }
return codegenProperty; return codegenProperty;