Skip to content

Commit a1a8dd7

Browse files
authored
Merge pull request #42551 from jsoref/spelling-refactoring
Spelling refactoring
2 parents c9dcca4 + 6fd6b13 commit a1a8dd7

33 files changed

+123
-123
lines changed

test/refactoring/ConvertAsync/convert_bool.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ func testConvertBool() async throws {
320320

321321
// Don't handle the case where multiple flag checks are done in a single
322322
// condition, because it's not exactly clear what the user is doing. It's a
323-
// little unfortunate that we'll allow multiple flag checks in seperate
323+
// little unfortunate that we'll allow multiple flag checks in separate
324324
// conditions, but both of these cases seem somewhat uncommon, and there's no
325325
// real way to completely enforce a single flag param across e.g multiple calls
326326
// to the same function, so this is probably okay for now.

test/refactoring/ConvertAsync/convert_params_single.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ func testParamsSingle() async throws {
486486

487487
// Note this transform results in invalid code as str.count.bitWidth is no
488488
// longer optional, but arguably it's more useful than leaving str as a
489-
// placeholder. In general, the tranform we perform here is locally valid
489+
// placeholder. In general, the transform we perform here is locally valid
490490
// within the optional chain, but may change the type of the overall chain.
491491
// UNWRAPPING-NEXT: _ = (str.count.bitWidth)!
492492

test/refactoring/ConvertAsync/convert_to_continuation.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,12 @@ func testReturnNonOptionalValuesForResultAndError(completion: @escaping (Int?, E
510510
// NON-OPTIONAL-VALUE-FOR-RESULT-AND-ERROR-NEXT: }
511511

512512
// RUN: %refactor-check-compiles -convert-to-async -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=MIXED-OPTIONAL-AND-NON-OPTIONAL-RESULT %s
513-
func testMixedOptionalAnNonOptionaResults(completion: @escaping (Int?, String?, Error?) -> Void) {
513+
func testMixedOptionalAnNonOptionalResults(completion: @escaping (Int?, String?, Error?) -> Void) {
514514
withoutAsyncAlternativeThrowing { (theResult, error) in
515515
completion(theResult, "hi", nil)
516516
}
517517
}
518-
// MIXED-OPTIONAL-AND-NON-OPTIONAL-RESULT: func testMixedOptionalAnNonOptionaResults() async throws -> (Int, String) {
518+
// MIXED-OPTIONAL-AND-NON-OPTIONAL-RESULT: func testMixedOptionalAnNonOptionalResults() async throws -> (Int, String) {
519519
// MIXED-OPTIONAL-AND-NON-OPTIONAL-RESULT-NEXT: return try await withCheckedThrowingContinuation { continuation in
520520
// MIXED-OPTIONAL-AND-NON-OPTIONAL-RESULT-NEXT: withoutAsyncAlternativeThrowing { (theResult, error) in
521521
// MIXED-OPTIONAL-AND-NON-OPTIONAL-RESULT-NEXT: guard let theResult1 = theResult else {
@@ -567,28 +567,28 @@ func testPassSameResultTwice(completion: @escaping (Int?, Int?, Error?) -> Void)
567567
// PASS-SAME-RESULT-TWICE-NEXT: }
568568

569569

570-
// RUN: %refactor-check-compiles -convert-to-async -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL %s
570+
// RUN: %refactor-check-compiles -convert-to-async -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL %s
571571
func testUseResultAfterAmbiguousCompletionHandlerCall(completion: @escaping (Int?, Error?) -> Void) {
572572
withoutAsyncAlternativeThrowing { (theResult, error) in
573573
completion(theResult, error)
574574
print(theResult as Any)
575575
}
576576
}
577-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL: func testUseResultAfterAmbiguousCompletionHandlerCall() async throws -> Int {
578-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: return try await withCheckedThrowingContinuation { continuation in
579-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: withoutAsyncAlternativeThrowing { (theResult, error) in
580-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: if let error = error {
581-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: continuation.resume(throwing: error)
582-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: } else {
583-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: guard let theResult1 = theResult else {
584-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: fatalError("Expected non-nil result 'theResult1' in the non-error case")
585-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: }
586-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: continuation.resume(returning: theResult1)
587-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: }
588-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: print(theResult as Any)
589-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: }
590-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: }
591-
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: }
577+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL: func testUseResultAfterAmbiguousCompletionHandlerCall() async throws -> Int {
578+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: return try await withCheckedThrowingContinuation { continuation in
579+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: withoutAsyncAlternativeThrowing { (theResult, error) in
580+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: if let error = error {
581+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: continuation.resume(throwing: error)
582+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: } else {
583+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: guard let theResult1 = theResult else {
584+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: fatalError("Expected non-nil result 'theResult1' in the non-error case")
585+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: }
586+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: continuation.resume(returning: theResult1)
587+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: }
588+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: print(theResult as Any)
589+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: }
590+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: }
591+
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: }
592592

593593
// RUN: %refactor-check-compiles -convert-to-async -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=TWO-COMPLEITON-HANDLER-CALLS %s
594594
func testTwoCompletionHandlerCalls(completion: @escaping (Int?, Error?) -> Void) {

test/refactoring/ConvertAsync/labeled_closure_params.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
// RUN: %empty-directory(%t)
44

55
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=MULTIPLE-LABELED-RESULTS %s
6-
func mutlipleLabeledResults(completion: @escaping (_ first: String, _ second: String) -> Void) { }
6+
func multipleLabeledResults(completion: @escaping (_ first: String, _ second: String) -> Void) { }
77
// MULTIPLE-LABELED-RESULTS: {
88
// MULTIPLE-LABELED-RESULTS-NEXT: Task {
9-
// MULTIPLE-LABELED-RESULTS-NEXT: let result = await mutlipleLabeledResults()
9+
// MULTIPLE-LABELED-RESULTS-NEXT: let result = await multipleLabeledResults()
1010
// MULTIPLE-LABELED-RESULTS-NEXT: completion(result.first, result.second)
1111
// MULTIPLE-LABELED-RESULTS-NEXT: }
1212
// MULTIPLE-LABELED-RESULTS-NEXT: }
13-
// MULTIPLE-LABELED-RESULTS: func mutlipleLabeledResults() async -> (first: String, second: String) { }
13+
// MULTIPLE-LABELED-RESULTS: func multipleLabeledResults() async -> (first: String, second: String) { }
1414

1515
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=MIXED-LABELED-RESULTS %s
1616
func mixedLabeledResult(completion: @escaping (_ first: String, String) -> Void) { }
@@ -62,11 +62,11 @@ func multipleLabeledResultWithError(completion: @escaping (_ first: String?, _ s
6262

6363
func testConvertCall() {
6464
// RUN: %refactor -convert-call-to-async-alternative -dump-text -source-filename %s -pos=%(line+1):3 | %FileCheck -check-prefix=CONVERT-CALL %s
65-
mutlipleLabeledResults() { (a, b) in
65+
multipleLabeledResults() { (a, b) in
6666
print(a)
6767
print(b)
6868
}
69-
// CONVERT-CALL: let (a, b) = await mutlipleLabeledResults()
69+
// CONVERT-CALL: let (a, b) = await multipleLabeledResults()
7070
// CONVERT-CALL-NEXT: print(a)
7171
// CONVERT-CALL-NEXT: print(b)
7272
}

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L108-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ func checkCaseCondition() {
5757
}
5858

5959
func checkOptionalBindingCondition(optional: String?) {
60-
if let unwraped = optional {
61-
print(unwraped)
60+
if let unwrapped = optional {
61+
print(unwrapped)
6262
}
6363

64-
if var unwraped = optional {
65-
unwraped += "!"
66-
print(unwraped)
64+
if var unwrapped = optional {
65+
unwrapped += "!"
66+
print(unwrapped)
6767
}
6868
}
6969

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L118-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ func checkCaseCondition() {
5757
}
5858

5959
func checkOptionalBindingCondition(optional: String?) {
60-
if let unwraped = optional {
61-
print(unwraped)
60+
if let unwrapped = optional {
61+
print(unwrapped)
6262
}
6363

64-
if var unwraped = optional {
65-
unwraped += "!"
66-
print(unwraped)
64+
if var unwrapped = optional {
65+
unwrapped += "!"
66+
print(unwrapped)
6767
}
6868
}
6969

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L128-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ func checkCaseCondition() {
5757
}
5858

5959
func checkOptionalBindingCondition(optional: String?) {
60-
if let unwraped = optional {
61-
print(unwraped)
60+
if let unwrapped = optional {
61+
print(unwrapped)
6262
}
6363

64-
if var unwraped = optional {
65-
unwraped += "!"
66-
print(unwraped)
64+
if var unwrapped = optional {
65+
unwrapped += "!"
66+
print(unwrapped)
6767
}
6868
}
6969

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L20-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ func checkCaseCondition() {
5858
}
5959

6060
func checkOptionalBindingCondition(optional: String?) {
61-
if let unwraped = optional {
62-
print(unwraped)
61+
if let unwrapped = optional {
62+
print(unwrapped)
6363
}
6464

65-
if var unwraped = optional {
66-
unwraped += "!"
67-
print(unwraped)
65+
if var unwrapped = optional {
66+
unwrapped += "!"
67+
print(unwrapped)
6868
}
6969
}
7070

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L29-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ func checkCaseCondition() {
6060
}
6161

6262
func checkOptionalBindingCondition(optional: String?) {
63-
if let unwraped = optional {
64-
print(unwraped)
63+
if let unwrapped = optional {
64+
print(unwrapped)
6565
}
6666

67-
if var unwraped = optional {
68-
unwraped += "!"
69-
print(unwraped)
67+
if var unwrapped = optional {
68+
unwrapped += "!"
69+
print(unwrapped)
7070
}
7171
}
7272

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L39-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ func checkCaseCondition() {
5858
}
5959

6060
func checkOptionalBindingCondition(optional: String?) {
61-
if let unwraped = optional {
62-
print(unwraped)
61+
if let unwrapped = optional {
62+
print(unwrapped)
6363
}
6464

65-
if var unwraped = optional {
66-
unwraped += "!"
67-
print(unwraped)
65+
if var unwrapped = optional {
66+
unwrapped += "!"
67+
print(unwrapped)
6868
}
6969
}
7070

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L50-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ break
6060
}
6161

6262
func checkOptionalBindingCondition(optional: String?) {
63-
if let unwraped = optional {
64-
print(unwraped)
63+
if let unwrapped = optional {
64+
print(unwrapped)
6565
}
6666

67-
if var unwraped = optional {
68-
unwraped += "!"
69-
print(unwraped)
67+
if var unwrapped = optional {
68+
unwrapped += "!"
69+
print(unwrapped)
7070
}
7171
}
7272

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L54-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ break
6060
}
6161

6262
func checkOptionalBindingCondition(optional: String?) {
63-
if let unwraped = optional {
64-
print(unwraped)
63+
if let unwrapped = optional {
64+
print(unwrapped)
6565
}
6666

67-
if var unwraped = optional {
68-
unwraped += "!"
69-
print(unwraped)
67+
if var unwrapped = optional {
68+
unwrapped += "!"
69+
print(unwrapped)
7070
}
7171
}
7272

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L60-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ func checkCaseCondition() {
5858

5959
func checkOptionalBindingCondition(optional: String?) {
6060
switch optional {
61-
case let unwraped?:
62-
print(unwraped)
61+
case let unwrapped?:
62+
print(unwrapped)
6363
default:
6464
break
6565
}
6666

67-
if var unwraped = optional {
68-
unwraped += "!"
69-
print(unwraped)
67+
if var unwrapped = optional {
68+
unwrapped += "!"
69+
print(unwrapped)
7070
}
7171
}
7272

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L64-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ func checkCaseCondition() {
5757
}
5858

5959
func checkOptionalBindingCondition(optional: String?) {
60-
if let unwraped = optional {
61-
print(unwraped)
60+
if let unwrapped = optional {
61+
print(unwrapped)
6262
}
6363

6464
switch optional {
65-
case var unwraped?:
66-
unwraped += "!"
67-
print(unwraped)
65+
case var unwrapped?:
66+
unwrapped += "!"
67+
print(unwrapped)
6868
default:
6969
break
7070
}

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L71-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ func checkCaseCondition() {
5757
}
5858

5959
func checkOptionalBindingCondition(optional: String?) {
60-
if let unwraped = optional {
61-
print(unwraped)
60+
if let unwrapped = optional {
61+
print(unwrapped)
6262
}
6363

64-
if var unwraped = optional {
65-
unwraped += "!"
66-
print(unwraped)
64+
if var unwrapped = optional {
65+
unwrapped += "!"
66+
print(unwrapped)
6767
}
6868
}
6969

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L82-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ func checkCaseCondition() {
5757
}
5858

5959
func checkOptionalBindingCondition(optional: String?) {
60-
if let unwraped = optional {
61-
print(unwraped)
60+
if let unwrapped = optional {
61+
print(unwrapped)
6262
}
6363

64-
if var unwraped = optional {
65-
unwraped += "!"
66-
print(unwraped)
64+
if var unwrapped = optional {
65+
unwrapped += "!"
66+
print(unwrapped)
6767
}
6868
}
6969

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L9-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ func checkCaseCondition() {
5757
}
5858

5959
func checkOptionalBindingCondition(optional: String?) {
60-
if let unwraped = optional {
61-
print(unwraped)
60+
if let unwrapped = optional {
61+
print(unwrapped)
6262
}
6363

64-
if var unwraped = optional {
65-
unwraped += "!"
66-
print(unwraped)
64+
if var unwrapped = optional {
65+
unwrapped += "!"
66+
print(unwrapped)
6767
}
6868
}
6969

test/refactoring/ConvertToSwitchStmt/Outputs/basic/L99-3.swift.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ func checkCaseCondition() {
5757
}
5858

5959
func checkOptionalBindingCondition(optional: String?) {
60-
if let unwraped = optional {
61-
print(unwraped)
60+
if let unwrapped = optional {
61+
print(unwrapped)
6262
}
6363

64-
if var unwraped = optional {
65-
unwraped += "!"
66-
print(unwraped)
64+
if var unwrapped = optional {
65+
unwrapped += "!"
66+
print(unwrapped)
6767
}
6868
}
6969

test/refactoring/ConvertToSwitchStmt/basic.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ func checkCaseCondition() {
5757
}
5858

5959
func checkOptionalBindingCondition(optional: String?) {
60-
if let unwraped = optional {
61-
print(unwraped)
60+
if let unwrapped = optional {
61+
print(unwrapped)
6262
}
6363

64-
if var unwraped = optional {
65-
unwraped += "!"
66-
print(unwraped)
64+
if var unwrapped = optional {
65+
unwrapped += "!"
66+
print(unwrapped)
6767
}
6868
}
6969

0 commit comments

Comments
 (0)