@@ -906,16 +906,15 @@ func testKeyPathHole() {
906
906
f ( \. x) // expected-error {{cannot infer key path type from context; consider explicitly specifying a root type}} {{6-6=<#Root#>}}
907
907
f ( \. x. y) // expected-error {{cannot infer key path type from context; consider explicitly specifying a root type}} {{6-6=<#Root#>}}
908
908
909
- // FIXME(SR-12827): Instead of "generic parameter 'T' could not be inferred",
910
- // we should offer the same diagnostic as above.
911
- func provideValueButNotRoot< T> ( _ fn: ( T ) -> String ) { } // expected-note 2{{in call to function 'provideValueButNotRoot'}}
912
- provideValueButNotRoot ( \. x) // expected-error {{generic parameter 'T' could not be inferred}}
913
- provideValueButNotRoot ( \. x. y) // expected-error {{generic parameter 'T' could not be inferred}}
909
+ func provideValueButNotRoot< T> ( _ fn: ( T ) -> String ) { }
910
+ provideValueButNotRoot ( \. x) // expected-error {{cannot infer key path type from context; consider explicitly specifying a root type}}
911
+ provideValueButNotRoot ( \. x. y) // expected-error {{cannot infer key path type from context; consider explicitly specifying a root type}}
914
912
provideValueButNotRoot ( \String . foo) // expected-error {{value of type 'String' has no member 'foo'}}
915
913
916
- func provideKPValueButNotRoot< T> ( _ kp: KeyPath < T , String > ) { } // expected-note 3{{in call to function 'provideKPValueButNotRoot'}}
917
- provideKPValueButNotRoot ( \. x) // expected-error {{generic parameter 'T' could not be inferred}}
918
- provideKPValueButNotRoot ( \. x. y) // expected-error {{generic parameter 'T' could not be inferred}}
914
+ func provideKPValueButNotRoot< T> ( _ kp: KeyPath < T , String > ) { } // expected-note {{in call to function 'provideKPValueButNotRoot'}}
915
+ provideKPValueButNotRoot ( \. x) // expected-error {{cannot infer key path type from context; consider explicitly specifying a root type}}
916
+ provideKPValueButNotRoot ( \. x. y) // expected-error {{cannot infer key path type from context; consider explicitly specifying a root type}}
917
+
919
918
provideKPValueButNotRoot ( \String . foo)
920
919
// expected-error@-1 {{value of type 'String' has no member 'foo'}}
921
920
// expected-error@-2 {{generic parameter 'T' could not be inferred}}
0 commit comments