mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #42551 from jsoref/spelling-refactoring
Spelling refactoring
This commit is contained in:
@@ -320,7 +320,7 @@ func testConvertBool() async throws {
|
||||
|
||||
// Don't handle the case where multiple flag checks are done in a single
|
||||
// condition, because it's not exactly clear what the user is doing. It's a
|
||||
// little unfortunate that we'll allow multiple flag checks in seperate
|
||||
// little unfortunate that we'll allow multiple flag checks in separate
|
||||
// conditions, but both of these cases seem somewhat uncommon, and there's no
|
||||
// real way to completely enforce a single flag param across e.g multiple calls
|
||||
// to the same function, so this is probably okay for now.
|
||||
|
||||
@@ -486,7 +486,7 @@ func testParamsSingle() async throws {
|
||||
|
||||
// Note this transform results in invalid code as str.count.bitWidth is no
|
||||
// longer optional, but arguably it's more useful than leaving str as a
|
||||
// placeholder. In general, the tranform we perform here is locally valid
|
||||
// placeholder. In general, the transform we perform here is locally valid
|
||||
// within the optional chain, but may change the type of the overall chain.
|
||||
// UNWRAPPING-NEXT: _ = (str.count.bitWidth)!
|
||||
|
||||
|
||||
@@ -510,12 +510,12 @@ func testReturnNonOptionalValuesForResultAndError(completion: @escaping (Int?, E
|
||||
// NON-OPTIONAL-VALUE-FOR-RESULT-AND-ERROR-NEXT: }
|
||||
|
||||
// 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
|
||||
func testMixedOptionalAnNonOptionaResults(completion: @escaping (Int?, String?, Error?) -> Void) {
|
||||
func testMixedOptionalAnNonOptionalResults(completion: @escaping (Int?, String?, Error?) -> Void) {
|
||||
withoutAsyncAlternativeThrowing { (theResult, error) in
|
||||
completion(theResult, "hi", nil)
|
||||
}
|
||||
}
|
||||
// MIXED-OPTIONAL-AND-NON-OPTIONAL-RESULT: func testMixedOptionalAnNonOptionaResults() async throws -> (Int, String) {
|
||||
// MIXED-OPTIONAL-AND-NON-OPTIONAL-RESULT: func testMixedOptionalAnNonOptionalResults() async throws -> (Int, String) {
|
||||
// MIXED-OPTIONAL-AND-NON-OPTIONAL-RESULT-NEXT: return try await withCheckedThrowingContinuation { continuation in
|
||||
// MIXED-OPTIONAL-AND-NON-OPTIONAL-RESULT-NEXT: withoutAsyncAlternativeThrowing { (theResult, error) in
|
||||
// MIXED-OPTIONAL-AND-NON-OPTIONAL-RESULT-NEXT: guard let theResult1 = theResult else {
|
||||
@@ -567,28 +567,28 @@ func testPassSameResultTwice(completion: @escaping (Int?, Int?, Error?) -> Void)
|
||||
// PASS-SAME-RESULT-TWICE-NEXT: }
|
||||
|
||||
|
||||
// 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
|
||||
// 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
|
||||
func testUseResultAfterAmbiguousCompletionHandlerCall(completion: @escaping (Int?, Error?) -> Void) {
|
||||
withoutAsyncAlternativeThrowing { (theResult, error) in
|
||||
completion(theResult, error)
|
||||
print(theResult as Any)
|
||||
}
|
||||
}
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL: func testUseResultAfterAmbiguousCompletionHandlerCall() async throws -> Int {
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: return try await withCheckedThrowingContinuation { continuation in
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: withoutAsyncAlternativeThrowing { (theResult, error) in
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: if let error = error {
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: continuation.resume(throwing: error)
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: } else {
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: guard let theResult1 = theResult else {
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: fatalError("Expected non-nil result 'theResult1' in the non-error case")
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: }
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: continuation.resume(returning: theResult1)
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: }
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: print(theResult as Any)
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: }
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: }
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANLDER-CALL-NEXT: }
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL: func testUseResultAfterAmbiguousCompletionHandlerCall() async throws -> Int {
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: return try await withCheckedThrowingContinuation { continuation in
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: withoutAsyncAlternativeThrowing { (theResult, error) in
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: if let error = error {
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: continuation.resume(throwing: error)
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: } else {
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: guard let theResult1 = theResult else {
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: fatalError("Expected non-nil result 'theResult1' in the non-error case")
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: }
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: continuation.resume(returning: theResult1)
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: }
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: print(theResult as Any)
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: }
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: }
|
||||
// USE-RESULT-AFTER-AMBIGUOUS-HANDLER-CALL-NEXT: }
|
||||
|
||||
// RUN: %refactor-check-compiles -convert-to-async -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=TWO-COMPLEITON-HANDLER-CALLS %s
|
||||
func testTwoCompletionHandlerCalls(completion: @escaping (Int?, Error?) -> Void) {
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
|
||||
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=MULTIPLE-LABELED-RESULTS %s
|
||||
func mutlipleLabeledResults(completion: @escaping (_ first: String, _ second: String) -> Void) { }
|
||||
func multipleLabeledResults(completion: @escaping (_ first: String, _ second: String) -> Void) { }
|
||||
// MULTIPLE-LABELED-RESULTS: {
|
||||
// MULTIPLE-LABELED-RESULTS-NEXT: Task {
|
||||
// MULTIPLE-LABELED-RESULTS-NEXT: let result = await mutlipleLabeledResults()
|
||||
// MULTIPLE-LABELED-RESULTS-NEXT: let result = await multipleLabeledResults()
|
||||
// MULTIPLE-LABELED-RESULTS-NEXT: completion(result.first, result.second)
|
||||
// MULTIPLE-LABELED-RESULTS-NEXT: }
|
||||
// MULTIPLE-LABELED-RESULTS-NEXT: }
|
||||
// MULTIPLE-LABELED-RESULTS: func mutlipleLabeledResults() async -> (first: String, second: String) { }
|
||||
// MULTIPLE-LABELED-RESULTS: func multipleLabeledResults() async -> (first: String, second: String) { }
|
||||
|
||||
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=MIXED-LABELED-RESULTS %s
|
||||
func mixedLabeledResult(completion: @escaping (_ first: String, String) -> Void) { }
|
||||
@@ -62,11 +62,11 @@ func multipleLabeledResultWithError(completion: @escaping (_ first: String?, _ s
|
||||
|
||||
func testConvertCall() {
|
||||
// RUN: %refactor -convert-call-to-async-alternative -dump-text -source-filename %s -pos=%(line+1):3 | %FileCheck -check-prefix=CONVERT-CALL %s
|
||||
mutlipleLabeledResults() { (a, b) in
|
||||
multipleLabeledResults() { (a, b) in
|
||||
print(a)
|
||||
print(b)
|
||||
}
|
||||
// CONVERT-CALL: let (a, b) = await mutlipleLabeledResults()
|
||||
// CONVERT-CALL: let (a, b) = await multipleLabeledResults()
|
||||
// CONVERT-CALL-NEXT: print(a)
|
||||
// CONVERT-CALL-NEXT: print(b)
|
||||
}
|
||||
|
||||
@@ -57,13 +57,13 @@ func checkCaseCondition() {
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,13 +57,13 @@ func checkCaseCondition() {
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,13 +57,13 @@ func checkCaseCondition() {
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,13 +58,13 @@ func checkCaseCondition() {
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,13 +60,13 @@ func checkCaseCondition() {
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,13 +58,13 @@ func checkCaseCondition() {
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,13 +60,13 @@ break
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,13 +60,13 @@ break
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,15 +58,15 @@ func checkCaseCondition() {
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
switch optional {
|
||||
case let unwraped?:
|
||||
print(unwraped)
|
||||
case let unwrapped?:
|
||||
print(unwrapped)
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,14 +57,14 @@ func checkCaseCondition() {
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
switch optional {
|
||||
case var unwraped?:
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
case var unwrapped?:
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
@@ -57,13 +57,13 @@ func checkCaseCondition() {
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,13 +57,13 @@ func checkCaseCondition() {
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,13 +57,13 @@ func checkCaseCondition() {
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,13 +57,13 @@ func checkCaseCondition() {
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,13 +57,13 @@ func checkCaseCondition() {
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -400,15 +400,15 @@ extension TestAddEquatableStructConforming: Equatable {
|
||||
// RUN: %refactor -pos=139:3 -end-pos=139:4 -source-filename %s | %FileCheck %s -check-prefix=CHECK-NONE
|
||||
// RUN: %refactor -pos=140:13 -end-pos=140:15 -source-filename %s | %FileCheck %s -check-prefix=CHECK2
|
||||
|
||||
// RUN: %refactor -pos=144:1 -end-pos=148:4 -source-filename %s | %FileCheck %s -check-prefix=CHECK-EXTRCT-METHOD
|
||||
// RUN: %refactor -pos=158:1 -end-pos=162:4 -source-filename %s | %FileCheck %s -check-prefix=CHECK-EXTRCT-METHOD
|
||||
// RUN: %refactor -pos=144:1 -end-pos=148:4 -source-filename %s | %FileCheck %s -check-prefix=CHECK-EXTRACT-METHOD
|
||||
// RUN: %refactor -pos=158:1 -end-pos=162:4 -source-filename %s | %FileCheck %s -check-prefix=CHECK-EXTRACT-METHOD
|
||||
// RUN: %refactor -pos=152:1 -end-pos=154:4 -source-filename %s | %FileCheck %s -check-prefix=CHECK-NONE
|
||||
// RUN: %refactor -pos=166:1 -end-pos=168:4 -source-filename %s | %FileCheck %s -check-prefix=CHECK-NONE
|
||||
|
||||
// RUN: %refactor -source-filename %s -pos=173:12 | %FileCheck %s -check-prefix=CHECK-NONE
|
||||
// RUN: %refactor -source-filename %s -pos=174:12 | %FileCheck %s -check-prefix=CHECK-LOCALIZE-STRING
|
||||
|
||||
// RUN: %refactor -source-filename %s -pos=173:3 -end-pos=173:27| %FileCheck %s -check-prefix=CHECK-EXTRCT-METHOD
|
||||
// RUN: %refactor -source-filename %s -pos=173:3 -end-pos=173:27| %FileCheck %s -check-prefix=CHECK-EXTRACT-METHOD
|
||||
|
||||
// RUN: %refactor -source-filename %s -pos=179:3 | %FileCheck %s -check-prefix=CHECK-COLLAPSE-NESTED-IF
|
||||
// RUN: %refactor -source-filename %s -pos=186:3 | %FileCheck %s -check-prefix=CHECK-COLLAPSE-NESTED-IF
|
||||
@@ -477,9 +477,9 @@ extension TestAddEquatableStructConforming: Equatable {
|
||||
// CHECK-EXPAND-DEFAULT-NEXT: Expand Default
|
||||
// CHECK-EXPAND-DEFAULT-NEXT: Action ends
|
||||
|
||||
// CHECK-EXTRCT-METHOD: Action begins
|
||||
// CHECK-EXTRCT-METHOD-NEXT: Extract Method
|
||||
// CHECK-EXTRCT-METHOD-NEXT: Action ends
|
||||
// CHECK-EXTRACT-METHOD: Action begins
|
||||
// CHECK-EXTRACT-METHOD-NEXT: Extract Method
|
||||
// CHECK-EXTRACT-METHOD-NEXT: Action ends
|
||||
|
||||
// CHECK-LOCALIZE-STRING: Localize String
|
||||
|
||||
|
||||
@@ -63,13 +63,13 @@ func checkCaseCondition() {
|
||||
}
|
||||
|
||||
func checkOptionalBindingCondition(optional: String?) {
|
||||
if let unwraped = optional {
|
||||
print(unwraped)
|
||||
if let unwrapped = optional {
|
||||
print(unwrapped)
|
||||
}
|
||||
|
||||
if var unwraped = optional {
|
||||
unwraped += "!"
|
||||
print(unwraped)
|
||||
if var unwrapped = optional {
|
||||
unwrapped += "!"
|
||||
print(unwrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ func test5(_ x: Int) {
|
||||
print(x)
|
||||
}
|
||||
|
||||
func testCaputreVariable() {
|
||||
func testCaptureVariable() {
|
||||
let capturedVariableRenamed = 0
|
||||
|
||||
_ = { [capturedVariableRenamed] in
|
||||
|
||||
@@ -47,7 +47,7 @@ func test5(_ x: Int) {
|
||||
print(x)
|
||||
}
|
||||
|
||||
func testCaputreVariable() {
|
||||
func testCaptureVariable() {
|
||||
let capturedVariable = 0
|
||||
|
||||
_ = { [capturedVariable] in
|
||||
|
||||
@@ -47,7 +47,7 @@ func test5(_ x: Int) {
|
||||
print(x)
|
||||
}
|
||||
|
||||
func testCaputreVariable() {
|
||||
func testCaptureVariable() {
|
||||
let capturedVariable = 0
|
||||
|
||||
_ = { [capturedVariable] in
|
||||
|
||||
@@ -47,7 +47,7 @@ func test5(_ x: Int) {
|
||||
print(x)
|
||||
}
|
||||
|
||||
func testCaputreVariable() {
|
||||
func testCaptureVariable() {
|
||||
let capturedVariable = 0
|
||||
|
||||
_ = { [capturedVariable] in
|
||||
|
||||
@@ -47,7 +47,7 @@ func test5(_ x: Int) {
|
||||
print(x)
|
||||
}
|
||||
|
||||
func testCaputreVariable() {
|
||||
func testCaptureVariable() {
|
||||
let capturedVariable = 0
|
||||
|
||||
_ = { [capturedVariable] in
|
||||
|
||||
@@ -47,7 +47,7 @@ func test5(_ x: Int) {
|
||||
print(x)
|
||||
}
|
||||
|
||||
func testCaputreVariable() {
|
||||
func testCaptureVariable() {
|
||||
let capturedVariable = 0
|
||||
|
||||
_ = { [capturedVariable] in
|
||||
|
||||
@@ -47,7 +47,7 @@ func test5(_ x: Int) {
|
||||
print(x)
|
||||
}
|
||||
|
||||
func testCaputreVariable() {
|
||||
func testCaptureVariable() {
|
||||
let capturedVariable = 0
|
||||
|
||||
_ = { [capturedVariable] in
|
||||
|
||||
@@ -47,7 +47,7 @@ func test5(_ x: Int) {
|
||||
print(x)
|
||||
}
|
||||
|
||||
func testCaputreVariable() {
|
||||
func testCaptureVariable() {
|
||||
let capturedVariable = 0
|
||||
|
||||
_ = { [capturedVariable] in
|
||||
|
||||
@@ -47,7 +47,7 @@ func test5(_ x: Int) {
|
||||
print(x)
|
||||
}
|
||||
|
||||
func testCaputreVariable() {
|
||||
func testCaptureVariable() {
|
||||
let capturedVariable = 0
|
||||
|
||||
_ = { [capturedVariable] in
|
||||
|
||||
@@ -47,7 +47,7 @@ func test5(_ xRenamed: Int) {
|
||||
print(x)
|
||||
}
|
||||
|
||||
func testCaputreVariable() {
|
||||
func testCaptureVariable() {
|
||||
let capturedVariable = 0
|
||||
|
||||
_ = { [capturedVariable] in
|
||||
|
||||
@@ -47,7 +47,7 @@ func test5(_ x: Int) {
|
||||
print(xRenamed)
|
||||
}
|
||||
|
||||
func testCaputreVariable() {
|
||||
func testCaptureVariable() {
|
||||
let capturedVariable = 0
|
||||
|
||||
_ = { [capturedVariable] in
|
||||
|
||||
@@ -47,7 +47,7 @@ func test5(_ x: Int) {
|
||||
print(x)
|
||||
}
|
||||
|
||||
func testCaputreVariable() {
|
||||
func testCaptureVariable() {
|
||||
let capturedVariable = 0
|
||||
|
||||
_ = { [capturedVariable] in
|
||||
|
||||
Reference in New Issue
Block a user