AliSoftware / Dip

Simple Swift Dependency container. Use protocols to resolve your dependencies and avoid singletons / sharedInstances!
MIT License
978 stars 75 forks source link

resolve fails with Swift 4 #173

Closed danielsaidi closed 6 years ago

danielsaidi commented 7 years ago

I just created a brand new project in Xcode , then added Dip as one of the first external pods. The project won't build, since Dip fails with the following error:

Extraneous argument label 'tag:' in call

It occurs in RuntimeArguments when Dip runs resolve(tag: tag).

I forked and opened the project locally. It builds correctly at first, but after migrating to Swift 4, I get the same errors as I got when adding the 5.1 pod with CocoaPods.

I have created a pull request that solves these errors (although perhaps the fixes are incorrect...you decide) but when I do, I am stuck with the same register error as is reported in another issue.

danielsaidi commented 7 years ago

I have forked Dip and added Swift 4 migrations and fixes for bugs that appeared as a result of the migration.

After migrating, the register problem (https://github.com/AliSoftware/Dip/issues/172) appeared, which I fixed with https://gist.github.com/Arasthel/38434fccf17e78fcf370f4724d86c2ff.

I have verified that these fixes work in the project I'm working with, at least to resolve with zero arguments. The pull request also fixes https://github.com/AliSoftware/Dip/issues/172