Importing nested enum

C++ interoperability is a huge amount of work, I'm so impressed by the effort that's gone into it thus far and where it's at.

I've decided to wait a bit for my use case, because I would still have to write C wrappers to deal with thunking blocks to std::function, dispatching virtual member functions, etc. I'm excited for when these limitations are removed.

Before doing that I thought I'd point out one issue with the importer, when I changed the type in a function declaration from uint16_t to LocalEntity::AemCommandStatus, it failed to import. I tried to hack around it by typedef'ing to uint16_t when not building the C++ library, but of course that fails at link time because the mangling is different.

class LocalEntity : public Entity
        /** Status code returned by all AEM (AECP) command methods. */
        enum class AemCommandStatus : std::uint16_t

Thanks for reaching out! It looks like it might be a semi-known issue related to nested enumerations which we are going to be fixing in the next week or two. Could you please file a GitHub issue on GitHub - apple/swift: The Swift Programming Language to track this fix, ideally with a small reproducer that demonstrates the problem?

Thanks Alex. 68473

1 Like