We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51) Target: x86_64-apple-darwin19.4.0
md5: 54264573fb7502c9478a950c75e2e178
duplicates:
Issue Description:
I am getting `Ambiguous use` errors on generic arities > 1, for example:
func foo<A>(_ closure: (A) -> Void) { } func foo<A, B>(_ closure: (A, B) -> Void) { } func foo<A, B, C>(_ closure: (A, B, C) -> Void) { } foo { (a: Int) in } foo { (a: Int, b: Int) in } // Ambiguous use of 'foo' foo { (a: Int, b: Int, c: Int) in } // Ambiguous use of 'foo'
A workaround for this is to 'tupl-ify' the function parameters with arities >1 like so:
func foo<A>(_ closure: (A) -> Void) { } func foo<A, B>(_ closure: ((A, B)) -> Void) { } // params wrapped in () func foo<A, B, C>(_ closure: ((A, B, C)) -> Void) { } // params wrapped in () foo { (a: Int) in } foo { (a: Int, b: Int) in } // ok foo { (a: Int, b: Int, c: Int) in } // ok
However without generics the original format works fine (no tupl-ifying required):
func foo(_ closure: (Int) -> Void) { } func foo(_ closure: (Int, Int) -> Void) { } func foo(_ closure: (Int, Int, Int) -> Void) { } foo { (a: Int) in } foo { (a: Int, b: Int) in } foo { (a: Int, b: Int, c: Int) in }
The text was updated successfully, but these errors were encountered:
I just tested on a near master build that I have, this seems fixed I think it is the same case of SR-8563
iankeen (JIRA User) can you please verify on the lastest master snapshot?
cc @xedin
Sorry, something went wrong.
@LucianoPAlmeida If you have tested it and it appears to be fixed I'd suggest you to either resolve or dupe it, that could always be reverted 🙂
Sure @xedin, I just confirm using the snapshot toolchain, seems fixed I'll dupe this 🙂
Comment by Ian Keen (JIRA)
thanks ya'll!
No branches or pull requests
Environment
Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
Target: x86_64-apple-darwin19.4.0
Additional Detail from JIRA
md5: 54264573fb7502c9478a950c75e2e178
duplicates:
Issue Description:
I am getting `Ambiguous use` errors on generic arities > 1, for example:
A workaround for this is to 'tupl-ify' the function parameters with arities >1 like so:
However without generics the original format works fine (no tupl-ifying required):
The text was updated successfully, but these errors were encountered: