I managed to reproduce the problem with the minimal test case you described. I’m pretty sure this is a bug in Xcode. You should definitely file a bug about it. Please post your bug number, just for the record.
Curiously, if I change
@class NSString; @protocol RMQChannel - (void) direct:(NSString *)name; @end
things work. I can then add the
@import Foundation;to other includes listed after
RMQChannel.hin the bridging header, and things still work. But any include of Foundation in or before
RMQChannel.htriggers the failure.
If I change the method name to something else (
-directQ, for example), it works.
If I switch
directto be a property, things work.
My conclusion is that something in Foundation has caused Swift’s C importer to mix up
direct, but anything beyond that would be pure speculation on my part. Regardless, it’s definitely Radar Time™.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"