Error using function any(_:of:)
when closure use generic types
#336
Labels
framework bug
Breaks tests or user testing code
any(_:of:)
when closure use generic types
#336
New Issue Checklist
Overview
Cannot use closures and an argument captor at the same time. It forces me to use classes.
Example
I think the problem starts because i need to declare the type of a closure and at the same time use an argument captor to return a value. If i try that, Xcode cannot run the test and it shows an error. And if i see inside
any(_:of:)
, it shows that i'm using the following functionany
functionBut if i don't use the argument captor, the error in the test disappear and i see that
any
is referring another functionany
functionThe only difference i see inside any functions is that in the first one it requires
T
to beAnyObject
. So, i'm wondering if this is a bug. Or what is the way to declare the type of a closure and also use an argument captor?Expected Behavior
It should let me run the test without showing an error.
Environment
0.20.0
)Xcode 15.0.1 | Swift 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
)The text was updated successfully, but these errors were encountered: