Skip to content

Commit deed208

Browse files
committed
Add an example and cross reference to TSPL.
Fixes <rdar://79689446>
1 parent 93c350d commit deed208

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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: (

0 commit comments

Comments
 (0)