Skip to content

Commit a911602

Browse files
committed
wip: warn_unqualified_access
1 parent 1a407a5 commit a911602

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

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

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,23 +2387,18 @@ struct ArrayBuilder {
23872387

23882388
### warn_unqualified_access
23892389

2390-
Apply this attribute to a
2391-
top-level function, instance method, or class or static method
2392-
to trigger warnings when that function or method is used
2393-
without a preceding qualifier,
2394-
such as a module name, type name, or instance variable or constant.
2395-
Use this attribute to help discourage ambiguity between functions
2396-
with the same name that are accessible from the same scope.
2397-
2398-
For example,
2399-
the Swift standard library includes both a top-level
2390+
将此特性应用于顶级函数、实例方法、类方法或静态方法,
2391+
以在使用该函数或方法时触发警告,
2392+
前提是没有前置限定符,
2393+
例如模块名称、类型名称或实例变量或常量。
2394+
使用此特性可以帮助减少在同一作用域中可访问的同名函数之间的歧义。
2395+
2396+
例如,Swift 标准库包括一个顶级函数
24002397
[`min(_:_:)`](https://developer.apple.com/documentation/swift/1538339-min/)
2401-
function and a
2402-
[`min()`](https://developer.apple.com/documentation/swift/sequence/1641174-min)
2403-
method for sequences with comparable elements.
2404-
The sequence method is declared with the `warn_unqualified_access` attribute
2405-
to help reduce confusion
2406-
when attempting to use one or the other from within a `Sequence` extension.
2398+
和一个用于具有可比较元素的序列的
2399+
[`min()`](https://developer.apple.com/documentation/swift/sequence/1641174-min) 方法。
2400+
序列方法使用 `warn_unqualified_access` 特性声明,
2401+
以帮助减少在 `Sequence` 扩展中尝试使用其中一个或另一个时的混淆。
24072402

24082403
### Declaration Attributes Used by Interface Builder
24092404

0 commit comments

Comments
 (0)