Skip to content

Commit

Permalink
Adds more examples with closures
Browse files Browse the repository at this point in the history
  • Loading branch information
ornithocoder committed Oct 18, 2017
1 parent 3ba3fd0 commit 95b798f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -7046,6 +7046,22 @@ class Foo {
}
```

```swift
class Foo {
class func foo(param1: Int,
param2: @escaping ((Int) -> Void)? = { _ in },
param3: Bool) { }
}
```

```swift
class Foo {
class func foo(param1: Int,
param2: @escaping ((Int) -> Void)? = { _ in },
param3: @escaping (Int, Int) -> Void = { _, _ in }) { }
}
```

</details>
<details>
<summary>Triggering Examples</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ internal struct MultilineParametersRuleExamples {
" class func foo(param1: Int,\n" +
" param2: Bool,\n" +
" param3: @escaping ((Int) -> Void)? = { _ in }) { }\n" +
"}",
"class Foo {\n" +
" class func foo(param1: Int,\n" +
" param2: @escaping ((Int) -> Void)? = { _ in },\n" +
" param3: Bool) { }\n" +
"}",
"class Foo {\n" +
" class func foo(param1: Int,\n" +
" param2: @escaping ((Int) -> Void)? = { _ in },\n" +
" param3: @escaping (Int, Int) -> Void = { _, _ in }) { }\n" +
"}"
]

Expand Down

0 comments on commit 95b798f

Please sign in to comment.