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?
case let test as (String) -> Void, compare stackoverflow.com/q/38980403/2976878enumwith associated values for each function type; then you can exhaustively switch without having to type-cast.