File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -444,9 +444,7 @@ extension UnsafePointer {
444444 /// - Returns: A pointer to the stored property represented
445445 /// by the key path, or `nil`.
446446 @_alwaysEmitIntoClient
447- #if $Embedded
448447 @_transparent
449- #endif
450448 public func pointer< Property> (
451449 to property: KeyPath < Pointee , Property >
452450 ) -> UnsafePointer < Property > ? {
@@ -1332,9 +1330,7 @@ extension UnsafeMutablePointer {
13321330 /// - Returns: A pointer to the stored property represented
13331331 /// by the key path, or `nil`.
13341332 @_alwaysEmitIntoClient
1335- #if $Embedded
13361333 @_transparent
1337- #endif
13381334 public func pointer< Property> (
13391335 to property: KeyPath < Pointee , Property >
13401336 ) -> UnsafePointer < Property > ? {
@@ -1356,9 +1352,7 @@ extension UnsafeMutablePointer {
13561352 /// - Returns: A mutable pointer to the stored property represented
13571353 /// by the key path, or `nil`.
13581354 @_alwaysEmitIntoClient
1359- #if $Embedded
13601355 @_transparent
1361- #endif
13621356 public func pointer< Property> (
13631357 to property: WritableKeyPath < Pointee , Property >
13641358 ) -> UnsafeMutablePointer < Property > ? {
Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-frontend %s -module-name=test -parse-as-library -emit-sil | %FileCheck %s
2+
3+ // REQUIRES: swift_stdlib_no_asserts,optimized_stdlib
4+
5+ public struct S {
6+ var a : Int
7+ var b : Int
8+ }
9+
10+ // Check that even with -Onone, no keypath is created.
11+
12+ // CHECK-LABEL: sil @$s4test6testitySPySiGSgSPyAA1SVGF :
13+ // CHECK-NOT: keypath
14+ // CHECK: } // end sil function '$s4test6testitySPySiGSgSPyAA1SVGF'
15+ public func testit( _ p: UnsafePointer < S > ) -> UnsafePointer < Int > ? {
16+ return p. pointer ( to: \. b)
17+ }
You can’t perform that action at this time.
0 commit comments