# "Expected a type" error on Appkit NSEvent.ModifierFlags enum

**URL:** <https://forums.swift.org/t/expected-a-type-error-on-appkit-nsevent-modifierflags-enum/67557>\
**Category:** C++ interoperability\
**Created:** [September 27, 2023, 6:32pm UTC](https://forums.swift.org/t/expected-a-type-error-on-appkit-nsevent-modifierflags-enum/67557 "2023-09-27T18:32:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikewoodworth](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mikewoodworth/32/25151_2.png) [@mikewoodworth](https://forums.swift.org/u/mikewoodworth)\
**Post date:** [September 27, 2023, 6:32pm UTC](https://forums.swift.org/t/expected-a-type-error-on-appkit-nsevent-modifierflags-enum/67557/1 "2023-09-27T18:32:16Z")

</div>

When I switch from objc to c++ interop in my Xcode 15 project I'm getting an "Expected a type" error on all references to NSEvent.ModifierFlags in my swift code. A quick google search turned up similar reports ([C++ interop flag makes NSTrackingArea behave differently · Issue #65885 · apple/swift · GitHub](https://github.com/apple/swift/issues/65885)) but these appear to have been closed prior to shipping? Any ideas? Workarounds?

Thanks,  
Mike

---

<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 28, 2023, 10:14pm UTC](https://forums.swift.org/t/expected-a-type-error-on-appkit-nsevent-modifierflags-enum/67557/2 "2023-09-28T22:14:16Z")

</div>

Could you please file an issue on [GitHub - apple/swift: The Swift Programming Language](http://github.com/apple/swift) with more details about the error you're getting? It's possible that there are still cases that have issues that need to be fixed.

---

<div class="post-metadata">

**Author:** ![tomhamming](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tomhamming/32/12153_2.png) [@tomhamming](https://forums.swift.org/u/tomhamming)\
**Post date:** [October 7, 2023, 12:46am UTC](https://forums.swift.org/t/expected-a-type-error-on-appkit-nsevent-modifierflags-enum/67557/3 "2023-10-07T00:46:35Z")

</div>

I am getting a similar error among some others when I turn on C++ interop.

> [@Build errors with C++ interop enabled](https://forums.swift.org/t/build-errors-with-c-interop-enabled/67637):
>
> I have a large legacy code base mostly in Objective-C that I'm eager to convert piecemeal to Swift, but it has a lot of C++ that it has to talk to. I've been looking forward to C++/Swift interop for a long time, and I'm really excited to see it happening! When I build my project with the C++ interop enabled in Xcode 15 (15A240d, public release), I get some errors that I don't understand. Should I file issues for any of these? Are there workarounds? Please advise how I can get around them and/or…
