File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -1039,18 +1039,6 @@ class C2_47269 {
1039
1039
}
1040
1040
}
1041
1041
1042
- // rdar://problem/32101765 - Keypath diagnostics are not actionable/helpful
1043
-
1044
- struct R32101765 { let prop32101765 = 0 }
1045
- let _: KeyPath < R32101765 , Float > = \. prop32101765
1046
- // expected-error@-1 {{key path value type 'Int' cannot be converted to contextual type 'Float'}}
1047
- let _: KeyPath < R32101765 , Float > = \R32101765 . prop32101765
1048
- // expected-error@-1 {{key path value type 'Int' cannot be converted to contextual type 'Float'}}
1049
- let _: KeyPath < R32101765 , Float > = \. prop32101765. unknown
1050
- // expected-error@-1 {{type 'Int' has no member 'unknown'}}
1051
- let _: KeyPath < R32101765 , Float > = \R32101765 . prop32101765. unknown
1052
- // expected-error@-1 {{type 'Int' has no member 'unknown'}}
1053
-
1054
1042
// rdar://problem/32390726 - Bad Diagnostic: Don't suggest `var` to `let` when binding inside for-statement
1055
1043
for var i in 0 ..< 10 { // expected-warning {{variable 'i' was never mutated; consider removing 'var' to make it constant}} {{5-9=}}
1056
1044
_ = i + 1
Original file line number Diff line number Diff line change @@ -247,3 +247,19 @@ func test_any_key_path() {
247
247
anyKP = \. v
248
248
// expected-error@-1 {{cannot infer key path type from context; consider explicitly specifying a root type}}
249
249
}
250
+
251
+ // rdar://problem/32101765 - Keypath diagnostics are not actionable/helpful
252
+ func rdar32101765( ) {
253
+ struct R32101765 {
254
+ let prop32101765 = 0
255
+ }
256
+
257
+ let _: KeyPath < R32101765 , Float > = \. prop32101765
258
+ // expected-error@-1 {{key path value type 'Int' cannot be converted to contextual type 'Float'}}
259
+ let _: KeyPath < R32101765 , Float > = \R32101765 . prop32101765
260
+ // expected-error@-1 {{key path value type 'Int' cannot be converted to contextual type 'Float'}}
261
+ let _: KeyPath < R32101765 , Float > = \. prop32101765. unknown
262
+ // expected-error@-1 {{type 'Int' has no member 'unknown'}}
263
+ let _: KeyPath < R32101765 , Float > = \R32101765 . prop32101765. unknown
264
+ // expected-error@-1 {{type 'Int' has no member 'unknown'}}
265
+ }
You can’t perform that action at this time.
0 commit comments