File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
swift-6.docc/LanguageGuide Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -750,7 +750,7 @@ class SomeOtherClass {
750750 ```
751751-->
752752
753- 如果 ` self ` 是结构体或枚举的实例,则始终可以隐式引用 ` self ` 。但是转义闭包无法捕获其对 ` self ` 的可变引用。结构体和枚举不允许共享可变性,如 < doc:ClassesAndStructures#结构体和枚举是值类型 > 中所述。
753+ 如果 ` self ` 是结构体或枚举的实例,则始终可以隐式引用 ` self ` 。但是逃逸闭包无法捕获其对 ` self ` 的可变引用。结构体和枚举不允许共享可变性,如 < doc:ClassesAndStructures#结构体和枚举是值类型 > 中所述。
754754
755755``` swift
756756struct SomeStruct {
@@ -789,7 +789,7 @@ struct SomeStruct {
789789 ```
790790-->
791791
792- 在上面的示例中,对 ` someFunctionWithEscapingClosure ` 函数的调用是一个错误,因为它位于一个可变函数中,因此 ` self ` 是可变的。这违反了规则,即转义闭包不能捕获对结构的 ` self ` 的可变引用。
792+ 在上面的示例中,对 ` someFunctionWithEscapingClosure ` 函数的调用是一个错误,因为它位于一个可变函数中,因此 ` self ` 是可变的。这违反了规则,即逃逸闭包不能捕获对结构的 ` self ` 的可变引用。
793793
794794<!--
795795 - test: `noescape-closure-as-argument`
You can’t perform that action at this time.
0 commit comments