Prevent methods renaming in Swift#155
Prevent methods renaming in Swift#155niparx wants to merge 2 commits intocross-language-cpp:mainfrom
Conversation
|
I suppose, some unit test should be created for this as well. Can somebody guide me here? |
|
Thanks a lot for the PR! Tests are in the src/it folder. Tests work basically so that there is an expected output file based on the given input.
The tests do compare the generated files with the expected ones. The test calls are in |
|
I haven't forgotten about the PR. I am just waiting on a little if tests will be added or not. |
Not forgotten. Writing tests + some minor improvements after feedback with Swift devs. |
|
Converting to |
If I'm using generated code in Swift project, then Swift will rename my methods into something else (they have some naming rules). That, basically brakes all thing: API then looking totally different. There is a macro
NS_SWIFT_NAME, where you can put a name, which Swift will use (something like "I know what I'm doing. Please, Swift, leave method name as it is written in macro."). So, there is an option for that: to add or not to add this macro to every method of generated API.Some more context about this Swift feature: