Skip to content

Files

Latest commit

 

History

History
47 lines (22 loc) · 725 Bytes

empty_parameters.md

File metadata and controls

47 lines (22 loc) · 725 Bytes

Pattern: Use of Void ->

Issue: -

Description

Prefer () -> over Void -> .

Examples of correct code:

let abc: () -> Void = {}


func foo(completion: () -> Void)


func foo(completion: () thows -> Void)


let foo: (ConfigurationTests) -> Void throws -> Void)


let foo: (ConfigurationTests) ->   Void throws -> Void)


let foo: (ConfigurationTests) ->Void throws -> Void)

Examples of incorrect code:

let abc: (Void) -> Void = {}


func foo(completion:(Void) -> Void)


func foo(completion:(Void) throws -> Void)


let foo:(Void) -> () throws -> Void)

Further Reading