File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1118,6 +1118,29 @@ func test_kp_as_function_mismatch() {
1118
1118
1119
1119
}
1120
1120
1121
+ func test_partial_keypath_inference( ) {
1122
+ // rdar://problem/34144827
1123
+
1124
+ struct S { var i : Int = 0 }
1125
+ enum E { case A( pkp: PartialKeyPath < S > ) }
1126
+
1127
+ _ = E . A ( pkp: \. i) // Ok
1128
+
1129
+ // rdar://problem/36472188
1130
+
1131
+ class ThePath {
1132
+ var isWinding : Bool ?
1133
+ }
1134
+
1135
+ func walk< T> ( aPath: T , forKey: PartialKeyPath < T > ) { }
1136
+ func walkThePath( aPath: ThePath , forKey: PartialKeyPath < ThePath > ) { }
1137
+
1138
+ func test( path: ThePath ) {
1139
+ walkThePath ( aPath: path, forKey: \. isWinding) // Ok
1140
+ walk ( aPath: path, forKey: \. isWinding) // Ok
1141
+ }
1142
+ }
1143
+
1121
1144
// SR-14499
1122
1145
struct SR14499_A { }
1123
1146
struct SR14499_B { }
You can’t perform that action at this time.
0 commit comments