I have some swift code, which is not really important in context of question. Also i have Objective-C bridging header ObjC-Swift-Bridging.h:
#import "my_objective_cpp_header.h"
And i have free C/C++ - style functions in that header:
inline void foo() {
}
inline void foo(int i) {
}
When i try to compile it in xcode 9.2 with enabled swift 4.0 i get error:
my_objective_cpp_header.h:29:13: error: redefinition of 'foo'
inline void foo(int i){
^
my_objective_cpp_header.h:26:13: note: previous definition is here
inline void foo() {
^
ObjC-Swift-Bridging.h:22:9: note: in file included from ObjC-Swift-Bridging.h:22:
#import "my_objective_cpp_header.h"
The same happens if i put these functions to C/C++ header and write
#include "my_cpp_header.h"
into ObjC-Swift-Bridging.h
So... Swift doesn't support code which was supported in Objective-C++? Did i miss something?