ikhvorost / ReactBridge

Swift Macros for React Native
MIT License
38 stars 4 forks source link

override is missing for methodQueue using ReactModule #4

Closed svipas closed 8 months ago

svipas commented 9 months ago

With @ReactModule(methodQueue: DispatchQueue.main) I get this error:

image

Seems like override is missing for methodQueue

ikhvorost commented 9 months ago

Hi! Looks like your class inherits the other one where methodQueue is already implemented. What class do you inherit your own or React's one? Please provide more info.

svipas commented 9 months ago

I'm using it with RCTEventEmitter if I'm not mistaken, I did not add it manually (the methodQueue). Problem is that override keyword is missing from what I can see in XCode errors then macro output expanded. I checked the source code and I see that you do override ? "override " : "", but not sure why it wasn't included, maybe somehow Bool was false of override? Also, why you don't want to use override always? At least as I checked you should always override it.

ikhvorost commented 9 months ago

If you make a module class that inherits from NSObject you have nothing to override but if it inherits from a class that is already implemented RCTBridgeModule (like RCTEventEmitter etc.) you have to and this is a question. I'm considering how to determine this case.

ikhvorost commented 9 months ago

The issue is fixed in 1.0.4, please try it out and thanks for bug reporting!

svipas commented 9 months ago

Thanks, I will try and I will let you know