Skip to content

Commit

Permalink
Emit internal enums when swift_implementation_only (#7545)
Browse files Browse the repository at this point in the history
- Copy the same pattern as structs and tables
- Fixes #7542
  • Loading branch information
pauley-unsaturated committed Sep 24, 2022
1 parent 4131158 commit cfe157e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/idl_gen_swift.cpp
Expand Up @@ -1198,7 +1198,8 @@ class SwiftGenerator : public BaseGenerator {

void GenEnum(const EnumDef &enum_def) {
if (enum_def.generated) return;
const auto is_private_access = enum_def.attributes.Lookup("private");
const bool is_private_access = parser_.opts.swift_implementation_only ||
enum_def.attributes.Lookup("private") != nullptr;
code_.SetValue("ENUM_TYPE",
enum_def.is_union ? "UnionEnum" : "Enum, Verifiable");
code_.SetValue("ACCESS_TYPE", is_private_access ? "internal" : "public");
Expand Down

0 comments on commit cfe157e

Please sign in to comment.