Skip to content

Commit 27803ae

Browse files
authored
Merge pull request #1423 from SwiftGGTeam/issue-1413
fixed issue 1413
2 parents fc249e5 + 6959c86 commit 27803ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

swift-6.docc/LanguageGuide/Closures.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
756756
struct 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`

0 commit comments

Comments
 (0)