# Importing nested enum

**URL:** <https://forums.swift.org/t/importing-nested-enum/67237>\
**Category:** Swift Async Algorithms\
**Created:** [September 12, 2023, 1:57am UTC](https://forums.swift.org/t/importing-nested-enum/67237 "2023-09-12T01:57:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukeh](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lukeh/32/31648_2.png) [@lukeh](https://forums.swift.org/u/lukeh)\
**Post date:** [September 12, 2023, 1:57am UTC](https://forums.swift.org/t/importing-nested-enum/67237/1 "2023-09-12T01:57:18Z")

</div>

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.

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

```

---

<div class="post-metadata">

**Author:** ![Alex\_L](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/alex_l/32/6202_2.png) [@Alex\_L](https://forums.swift.org/u/Alex_L)\
**Post date:** [September 12, 2023, 7:36pm UTC](https://forums.swift.org/t/importing-nested-enum/67237/2 "2023-09-12T19:36:24Z")

</div>

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](http://GitHub.com/apple/swift) to track this fix, ideally with a small reproducer that demonstrates the problem?

---

<div class="post-metadata">

**Author:** ![lukeh](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lukeh/32/31648_2.png) [@lukeh](https://forums.swift.org/u/lukeh)\
**Post date:** [September 12, 2023, 10:09pm UTC](https://forums.swift.org/t/importing-nested-enum/67237/3 "2023-09-12T22:09:13Z")

</div>

Thanks Alex. [68473](https://github.com/apple/swift/issues/68473)
