File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1054,6 +1054,16 @@ func testSyntaxErrors() {
1054
1054
_ = \A . a!;
1055
1055
}
1056
1056
1057
+ // SR-14644
1058
+ func sr14644 ( ) {
1059
+ _ = \Int . byteSwapped. signum ( ) // expected-error {{invalid component of Swift key path}}
1060
+ _ = \Int . byteSwapped. init ( ) // expected-error {{invalid component of Swift key path}}
1061
+ _ = \Int // expected-error {{key path must have at least one component}}
1062
+ _ = \Int ? // expected-error {{key path must have at least one component}}
1063
+ _ = \Int . // expected-error {{invalid component of Swift key path}}
1064
+ // expected-error@-1 {{expected member name following '.'}}
1065
+ }
1066
+
1057
1067
// SR-13364 - keypath missing optional crashes compiler: "Inactive constraints left over?"
1058
1068
func sr13364( ) {
1059
1069
let _: KeyPath < String ? , Int ? > = \. utf8. count // expected-error {{no exact matches in reference to property 'count'}}
You can’t perform that action at this time.
0 commit comments