atlj / react-native-kotlin-swift-backward-compatible-module

An example React Native library that uses Kotlin on Android and Swift on iOS.
MIT License
1 stars 1 forks source link

Adding an escaping to RCTPromiseResolveBlock cause a build error #1

Open RobertSasak opened 10 months ago

RobertSasak commented 10 months ago

This is not really an issue. I am testing your new setup in a fork https://github.com/RobertSasak/react-native-kotlin-swift-backward-compatible-module where I am trying to make a simple wrapper around Stripe iOS SDK.

I am experiencing an issue where adding a escaping to declaration of RCTPromiseResolveBlock cause a build error. It is a common practice to store resolve for later use and therefore mark it as escaping.

83:9: fatal error: 'react_native_kotlin_swift_backward_compatible_module/react_native_kotlin_swift_backward_compatible_module.h' file not found
#import <react_native_kotlin_swift_backward_compatible_module/react_native_kotlin_swift_backward_compatible_module.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Here is a actuall commit that breaks the build. https://github.com/RobertSasak/react-native-kotlin-swift-backward-compatible-module/commit/e9f63f608a563b705ece6693824fe8fdd452acfc

Feel free to close this issue if it is not interesting to you.

atlj commented 10 months ago

Oh, thanks a lot for noticing this one 🙌. I'm currently trying to use macros to simplify everything. So going forward, I will definitely take the @escaping into account.