Anonymous Argument in Multiline Closure

Use named arguments in multiline closures

  • Identifier: anonymous_argument_in_multiline_closure
  • Enabled by default: No
  • Supports autocorrection: No
  • Kind: idiomatic
  • Analyzer rule: No
  • Minimum Swift compiler version: 5.0.0
  • Default configuration:
    KeyValue
    severity warning

Non Triggering Examples

closure { $0 }
closure { print($0) }
closure { arg in
    print(arg)
}
closure { arg in
    nestedClosure { $0 + arg }
}

Triggering Examples

closure {
    print($0)
}