Skip to content

void_return

Ian Applebaum edited this page Jun 13, 2020 · 1 revision

Void Return

Prefer -> Void over -> ().

  • Identifier: void_return
  • Enabled by default: Enabled
  • Supports autocorrection: Yes
  • Kind: style
  • Analyzer rule: No
  • Minimum Swift compiler version: 3.0.0
  • Default configuration: warning

Non Triggering Examples

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)

Triggering Examples

let abc: () ->() = {}
let abc: () ->(Void) = {}
let abc: () ->(   Void ) = {}
func foo(completion: () ->())
func foo(completion: () ->(   ))
func foo(completion: () ->(Void))
let foo: (ConfigurationTests) -> () throws ->())
Clone this wiki locally