Consider this code:
func testA(){}
func testB(value:Int){}
func testC(value:String){}
var someTest:Any = testA
How do you case-match on a variable holding a closure to find the correct one so you can call it?
switch someTest{
case let test where test:() -> Void:
test()
case let test where test:(value:Int) -> Void:
test(4)
case let test where test:(value:String) -> Void:
test("A")
}
Is something like this possible?