Pattern: Use of -> ()
Issue: -
Prefer -> Void
over -> ()
.
Examples of correct code:
let abc: () -> Void = {}
let abc: () -> (VoidVoid) = {}
func foo(completion: () -> Void)
let foo: (ConfigurationTests) -> () throws -> Void)
let foo: (ConfigurationTests) -> () throws -> Void)
let foo: (ConfigurationTests) ->() throws -> Void)
let foo: (ConfigurationTests) -> () -> Void)
Examples of incorrect code:
let abc: () -> ↓() = {}
let abc: () -> ↓(Void) = {}
let abc: () -> ↓( Void ) = {}
func foo(completion: () -> ↓())
func foo(completion: () -> ↓( ))
func foo(completion: () -> ↓(Void))
let foo: (ConfigurationTests) -> () throws -> ↓())