Skip to content

Commit

Permalink
Merge pull request #1619 from realm/mf-continue-1609
Browse files Browse the repository at this point in the history
Fix crash in `unused_closure_parameter` rule
  • Loading branch information
marcelofabri authored Jun 13, 2017
2 parents c08a133 + 77588f0 commit 25ae8d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
[Marcelo Fabri](https://github.com/marcelofabri)
[#1597](https://github.com/realm/SwiftLint/issues/1597)

* Fix crash in `unused_closure_parameter` rule when using unicode identifiers.
[Woo-Sik Byun](https://github.com/woosiki)
[Marcelo Fabri](https://github.com/marcelofabri)

## 0.19.0: Coin-Operated Machine

##### Breaking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public struct UnusedClosureParameterRule: ASTRule, ConfigurationProviderRule, Co
"[1, 2].something { number, ↓idx in\n return number\n}\n",
"genericsFunc { (↓number: TypeA, idx: TypeB) in return idx\n}\n",
"hoge(arg: num) { ↓num in\n" +
"}\n"
"}\n",
"fooFunc { ↓아 in\n }"
],
corrections: [
"[1, 2].map { ↓number in\n return 3\n}\n":
Expand Down Expand Up @@ -118,7 +119,7 @@ public struct UnusedClosureParameterRule: ASTRule, ConfigurationProviderRule, Co
return nil
}

let paramLength = name.bridge().length
let paramLength = name.lengthOfBytes(using: .utf8)

let matches = regex.matches(in: file.contents, options: [], range: range).ranges()
for range in matches {
Expand Down

0 comments on commit 25ae8d3

Please sign in to comment.