Skip to content

Commit 8556e83

Browse files
authored
Merge pull request #60178 from amartini51/doc_fixes
Documentation fixes
2 parents 6c2f964 + 4d35aae commit 8556e83

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

stdlib/public/Concurrency/TaskGroup.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ public func withTaskGroup<ChildTaskResult, GroupResult>(
100100
/// you can use a `for`-`await`-`in` loop:
101101
///
102102
/// var sum = 0
103-
/// for await result in group {
103+
/// for try await result in group {
104104
/// sum += result
105105
/// }
106106
///
107107
/// If you need more control or only a few results,
108108
/// you can call `next()` directly:
109109
///
110-
/// guard let first = await group.next() else {
110+
/// guard let first = try await group.next() else {
111111
/// group.cancelAll()
112112
/// return 0
113113
/// }
@@ -580,7 +580,7 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
580580
///
581581
/// You can also use a `for`-`await`-`in` loop to collect results of a task group:
582582
///
583-
/// for await try value in group {
583+
/// for try await value in group {
584584
/// collected += value
585585
/// }
586586
///

stdlib/public/core/FloatingPoint.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public protocol FloatingPoint: SignedNumeric, Strideable, Hashable
328328
/// `infinity` is greater than this value.
329329
static var greatestFiniteMagnitude: Self { get }
330330

331-
/// The [mathematical constant π][wiki], approximately equal to 3.14159.
331+
/// The mathematical constant pi (π), approximately equal to 3.14159.
332332
///
333333
/// When measuring an angle in radians, π is equivalent to a half-turn.
334334
///
@@ -339,8 +339,6 @@ public protocol FloatingPoint: SignedNumeric, Strideable, Hashable
339339
///
340340
/// print(Double.pi)
341341
/// // Prints "3.14159265358979"
342-
///
343-
/// [wiki]: https://en.wikipedia.org/wiki/Pi
344342
static var pi: Self { get }
345343

346344
// NOTE: Rationale for "ulp" instead of "epsilon":

stdlib/public/core/FloatingPointTypes.swift.gyb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ def Availability(bits):
4141

4242
if Self == 'Float16':
4343
SelfDocComment = '''\
44-
/// A half-precision (16b), floating-point value type.'''
45-
44+
/// A half-precision (16b), floating-point value type.
45+
///
46+
/// `Float16` is available on Apple silicon,
47+
/// and unavailable on Intel when targeting macOS.'''
4648
elif Self == 'Float':
4749
SelfDocComment = '''\
4850
/// A single-precision, floating-point value type.'''
@@ -53,7 +55,11 @@ elif Self == 'Double':
5355

5456
elif Self == 'Float80':
5557
SelfDocComment = '''\
56-
/// An extended-precision, floating-point value type.'''
58+
/// An extended-precision, floating-point value type.
59+
///
60+
/// `Float80` is available on Intel
61+
/// when the target system supports an 80-bit long double type,
62+
/// and unavailable on Apple silicon.'''
5763

5864
else:
5965
raise ValueError('Unhandled float type.')

stdlib/public/core/KeyPath.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,14 @@ public class PartialKeyPath<Root>: AnyKeyPath { }
200200
internal enum KeyPathKind { case readOnly, value, reference }
201201

202202
/// A key path from a specific root type to a specific resulting value type.
203+
///
204+
/// The most common way to make an instance of this type
205+
/// is by using a key-path expression like `\SomeClass.someProperty`.
206+
/// For more information,
207+
/// see [Key-Path Expressions][keypath] in *[The Swift Programming Language][tspl]*.
208+
///
209+
/// [keypath]: https://docs.swift.org/swift-book/ReferenceManual/Expressions.html#ID563
210+
/// [tspl]: https://docs.swift.org/swift-book/
203211
public class KeyPath<Root, Value>: PartialKeyPath<Root> {
204212
@usableFromInline
205213
internal final override class var _rootAndValueType: (

stdlib/public/core/Optional.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
/// A type that represents either a wrapped value or `nil`, the absence of a
14-
/// value.
13+
/// A type that represents either a wrapped value or the absence of a value.
1514
///
1615
/// You use the `Optional` type whenever you use optional values, even if you
1716
/// never type the word `Optional`. Swift's type system usually shows the

0 commit comments

Comments
 (0)