Closed harleyjcooper closed 3 years ago
+1
Another workaround is to use the parameter labels, e.g.:
binder.bind().to(value: Cheese.cheddar)
binder.bind().to(value: Roll.ciabatta)
@harleyjcooper Seems to be an interesting issue surround the 0-arity factory
and value
functions. Opened a topic on the swift forums: https://forums.swift.org/t/ambiguous-use-of-function-with-trailing-closures/41144
@s-hocking 's workaround is the correct way to fix for now. The Cleanse library itself successfully compiles, I'll go ahead and fix the tests to disambiguate. I won't make any API changes for now and open a new issue to help any future consumers who run into a similar problems until we can figure out if this new compiler change is "correct" in marking these two functions as ambiguous with each other.
Merged updating the repo to compile & test using XC 12. Will open another issue to address the ambiguous function issue.
When building the Cleanse project in Xcode 12, it fails with a number of
Ambiguous use of 'to'
failures inMemoryManagementTests.swift
andCleanseTests.swift
.Compilation and unit tests succeed by making the return type explicit:
but it's more likely indicative of some underlying issue.