Skip to content

Commit afa0e5e

Browse files
committed
wip: autoclosure
1 parent ea51a97 commit afa0e5e

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

swift-6-beta.docc/ReferenceManual/Attributes.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,19 +2420,18 @@ Swift 提供了以下 Interface Builder 特性:
24202420
应用 `IBAction`, `IBSegueAction`, `IBOutlet`,
24212421
`IBDesignable`, 或 `IBInspectable` 特性也意味着 `objc` 特性。
24222422

2423-
## Type Attributes
2423+
## 类型特性
24242424

2425-
You can apply type attributes to types only.
2425+
您只能将类型特性应用于类型。
24262426

24272427
### autoclosure
24282428

2429-
Apply this attribute to delay the evaluation of an expression
2430-
by automatically wrapping that expression in a closure with no arguments.
2431-
You apply it to a parameter's type in a function or method declaration,
2432-
for a parameter whose type is a function type that takes no arguments
2433-
and that returns a value of the type of the expression.
2434-
For an example of how to use the `autoclosure` attribute,
2435-
see <doc:Closures#Autoclosures> and <doc:Types#Function-Type>.
2429+
将此特性应用于延迟表达式的求值,
2430+
通过自动将该表达式包装在一个没有参数的闭包中。
2431+
您将其应用于函数或方法声明中的参数类型,
2432+
适用于类型为不带参数且返回表达式类型值的函数类型的参数。
2433+
有关如何使用 `autoclosure` 特性的示例,
2434+
请参见文档:<doc:Closures#Autoclosures> 和文档:<doc:Types#Function-Type>
24362435

24372436
### convention
24382437

0 commit comments

Comments
 (0)