Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let f: () -> Void = { print("hi") }
- f()
- //f(()) // ERROR
- // let f2: (()) -> Void = { print("hi") } // ERROR
- let f2: (()) -> Void = { _ in print("hi2") }
- //f2() // ERROR
- f2(())
- f2((()))
- f2(((())))
- let f3: ((())) -> Void = { _ in print("hi3") }
- //f3() // ERROR
- f3(())
- f3((()))
- f3(((())))
- //let g: (Void) -> Void = { print("void") } // ERROR
- let g: (Void) -> Void = { _ in print("void") } // WARNING: When calling this function in Swift 4 or later, you must pass a '()' tuple; did you mean for the input type to be '()'?
- //g() // ERROR
- g(())
- g((()))
- g(((())))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement