NS_ENUM in Module header generates project warnings

I've googled and poked all over the web for a solution to this with no luck.


I build my mostly ObjectiveC project that includes an all Swift module. I very much want to share an enum (NS_ENUM). So I moved the enum from within the project to the Module header file. Great - I can build my Module just fine. And any ObjectiveC class headers that declare an enum property work just fine, using:


#import


The problem comes in the one file that really need to import the module (@import Module;), as it needs to access other public objects from within the module. When I do that, the build log as shown in the "Report Navigator" is clean.


But the errors/warning view under the triangle icon shows a slew of warnings that make it nearly impossible to find other warnings. The top level outline is named "Semantic Issue", and I get a slew of items that go like this:


"Reference to 'EnumValue' is ambiguous

FileName.m"


Then a little circle with an ! in it, and more text:


"Candiate found by name lookup is 'EnumName::EnumValue'"


I've tried everything I could think of (removed every DerivedData folder I had). Also tried insuring that no included file had a '#import <MyModule/MyModule.h>' in it that would appear before, or after, the @import Module;


Now I'm stuck. I don't know how I can share the enum between app and module.


Any ideas most appreciated!

Accepted Reply

I'm continuing to try and work this out. This morning I replaced every instance of:


#import <Module/Module.h>


with


@import Payments;


Now all those annoying warnings are gone!

Replies

I'm continuing to try and work this out. This morning I replaced every instance of:


#import <Module/Module.h>


with


@import Payments;


Now all those annoying warnings are gone!