Skip to content

[noescape by default] Add explicit @escaping as needed #577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Basic/OptionParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public protocol Argument {
associated value we will throw. If the argument was
passed `--foo=bar` and you don’t `pop` we also `throw`
*/
init?(argument: String, pop: () -> String?) throws
init?(argument: String, pop: @escaping () -> String?) throws
}

public func parseOptions<Mode: Argument, Flag: Argument>(arguments: [String]) throws -> (Mode?, [Flag]) where Mode: Equatable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Commands/SwiftBuildTool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private enum Mode: Argument, Equatable, CustomStringConvertible {
case usage
case version

init?(argument: String, pop: () -> String?) throws {
init?(argument: String, pop: @escaping () -> String?) throws {
switch argument {
case "--configuration", "--config", "-c":
self = try .build(Configuration(pop()), UserToolchain())
Expand Down
2 changes: 1 addition & 1 deletion Sources/Commands/SwiftPackageTool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private enum Mode: Argument, Equatable, CustomStringConvertible {
case usage
case version

init?(argument: String, pop: () -> String?) throws {
init?(argument: String, pop: @escaping () -> String?) throws {
switch argument {
case "dump-package":
self = .dumpPackage
Expand Down
2 changes: 1 addition & 1 deletion Sources/Commands/SwiftTestTool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private enum Mode: Argument, Equatable, CustomStringConvertible {
case listTests
case run(String?)

init?(argument: String, pop: () -> String?) throws {
init?(argument: String, pop: @escaping () -> String?) throws {
switch argument {
case "--help", "-h":
self = .usage
Expand Down
4 changes: 2 additions & 2 deletions Tests/BasicTests/OptionParserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class OptionParserTests: XCTestCase {
enum Mode: String, Argument {
case A, B, C

init?(argument: String, pop: () -> String?) throws {
init?(argument: String, pop: @escaping () -> String?) throws {
switch argument {
case "--A":
self = .A
Expand All @@ -158,7 +158,7 @@ enum Mode: String, Argument {
enum Flag: Argument, Equatable {
case D, E, F(String), G(Int), H, I, J, K(String)

init?(argument: String, pop: () -> String?) throws {
init?(argument: String, pop: @escaping () -> String?) throws {
switch argument {
case "--D":
self = .D
Expand Down