I noticed I am getting Class X.Y is implemented in both A and B when loading dylib importing module X while main module (the one that loads dylib) is importing same module X.
I created PluginInterface module that is supposed dynamically linked to PluginImplementation package which will create dylib. Then I created PluginConsumer package that loads libPluginImplementation.dylib and imports PluginInterface to be able to comunicate with the plugin. When I run PluginConsumer, I get mentioned error when I load dylib:
objc: Class _TtC15PluginInterface15PluginInterface is implemented in both /Users/Lope/Dev/swift/SwiftPlugins/PluginConsumer/.build/x86_64-apple-macosx10.10/debug/libPluginInterface.dylib (0x10fc7b668) and /Users/Lope/Dev/swift/SwiftPlugins/PluginImplementation/.build/x86_64-apple-macosx10.10/debug/libPluginInterface.dylib (0x1107dd668). One of the two will be used. Which one is undefined.
You can find all three packages in following repositories: