[Suggestion] Replace symbol hacks with AssociatedTypeRequirementsVisitor hacks#3
[Suggestion] Replace symbol hacks with AssociatedTypeRequirementsVisitor hacks#3nerdsupremacist wants to merge 2 commits intoa2:mainfrom
Conversation
I built a generic version of the hacks I debugged with @a2 for decomposition. This one does not use any of the symbol hacks from before, but instead is betting on the implementations on changing the default associated type of their parent protocol. This means we can get rid of all the linux workarounds 🎉
|
I noticed that you use some C code to call assembly directly. Do you know if that would work in the Swift Playgrounds app (#2)? |
|
Uhhh very good question. We can certainly try. We should try on both iPad and Mac. How can I get a playground working with this? |
|
You can generate a playground by running the following: I can test it on iPad, but I think the Playgrounds app only runs Swift, hence @liamnichols's decision to remove the Linux hacks for Darwin targets? |
|
You can open it up in the Swift Playgrounds app downloaded from the Mac App Store as well for testing to at least see that it compiles. But yeah, Swift Playgrounds only allow Swift source files so I had to conditionally opt out of using the Linux hacks and revert back to the prior work around |
|
Hmmm... What if we compile it (once for Mac once for iOS) and try to include the .framework... Perhaps that would work? I mean the Playgrounds App obviously can interact with already compiled frameworks, just no idea if we can add new ones |
I built a generic version of the hacks we went over for decomposition into actions.
This one does not use any of the symbol hacks from before, but instead is betting on the implementations on changing the default associated type of their parent protocol.
I want to be clear that this is almost the same hack. Just now you can't see it ;)
This means we can get rid of all the linux workarounds 🎉
It's completely fine if you don't want the added dependency, I just wanted to give you the option ;)
PS I have not tested on Linux. So let's hope the tests pass 🤞