appsquickly / typhoon

Powerful dependency injection for Objective-C ✨✨ (https://PILGRIM.PH is the pure Swift successor to Typhoon!!)✨✨
https://pilgrim.ph
Apache License 2.0
2.7k stars 269 forks source link

Factory message forwarding broken with dynamic frameworks without id return types #526

Closed itsthejb closed 6 years ago

itsthejb commented 8 years ago

Hi guys,

First of all, let me apologise for what will probably be a hard to follow issue for you. Not sure if this is a bug, a limitation, or an error at our end. We're hoping you might be able to give some input that helps us out!

We have a large legacy app that we're trying to modularise over time, into a number of internal (dynamic) frameworks. Dynamic necessary because we have some Swift, although the vast majority is ObjC. First two module frameworks went fine, but hid some strange snags with the third, which is quite a lot larger.

Suddenly, once we have our third module, components are no longer vended from the master assembly (unrecognized selector), unless the return type is defined as id in the module header!

This is certainly very strange, since to my knowing the runtime seems everything as id, and types are just for the compiler. Most of the code involved here is Objc, although there's some messy overlap between frameworks at the moment - which we intend to fix in the long term.

So... please let us know if this rings any bells to you all. Happy to discuss further. It's possible this is some quirk that dynamic frameworks has thrown into the mix.

Thanks, and sorry for the long issue!

jasperblues commented 8 years ago

Hi @itsthejb nice to hear from you. Sorry you've been facing issues though.

Have you got a sample project that produces the error? I can't see the return type mattering, but stranger things have happened with Swift.

itsthejb commented 8 years ago

Hi @jasperblues, nice to hear from you too.

I feared you might ask that! Well, not right now. I suppose it might be possible to create one, but I can certainly see it suddenly working perfectly if we strip away the cruft.

There's a very good chance that our modularizing-in-progress chaos is causing the issue, although it certainly is a head-scratcher.

Watch this space?

jasperblues commented 8 years ago

We could definitely help if you have a sample project. If that's tricky we can ask for breakpoints, logging, etc and troubleshoot with you.

itsthejb commented 8 years ago

May not be able to get to this today... But I can try (do have some overdue dependencies...).

jasperblues commented 8 years ago

take as much time as you need. you know where to find us.

jasperblues commented 6 years ago

Ever get this solved @itsthejb ?

itsthejb commented 6 years ago

Hi! I'm afraid not, but this is now ancient and I don't work on the project involved, so I'll close this. Thanks!