Commit 9779591
authored
[CSDiagnostics] Prevent nested type references in KeyPath components (#83625)
This change adds detection for nested type references in KeyPath
components and applies the appropriate fix to generate meaningful error
messages, following the same pattern already established for method
references.
The fix ensures that invalid KeyPath references fail gracefully in
normal mode and provide helpful diagnostics in diagnostic mode,
improving the developer experience when working with KeyPaths.
Resolves: #831971 parent 0e1be77 commit 9779591
File tree
6 files changed
+54
-0
lines changed- include/swift
- AST
- Sema
- lib/Sema
- test/expr/unary/keypath
6 files changed
+54
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
684 | 687 | | |
685 | 688 | | |
686 | 689 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2027 | 2027 | | |
2028 | 2028 | | |
2029 | 2029 | | |
| 2030 | + | |
| 2031 | + | |
2030 | 2032 | | |
2031 | 2033 | | |
2032 | 2034 | | |
| |||
2059 | 2061 | | |
2060 | 2062 | | |
2061 | 2063 | | |
| 2064 | + | |
| 2065 | + | |
2062 | 2066 | | |
2063 | 2067 | | |
2064 | 2068 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6494 | 6494 | | |
6495 | 6495 | | |
6496 | 6496 | | |
| 6497 | + | |
| 6498 | + | |
| 6499 | + | |
| 6500 | + | |
| 6501 | + | |
| 6502 | + | |
6497 | 6503 | | |
6498 | 6504 | | |
6499 | 6505 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1890 | 1890 | | |
1891 | 1891 | | |
1892 | 1892 | | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
1893 | 1914 | | |
1894 | 1915 | | |
1895 | 1916 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1288 | 1288 | | |
1289 | 1289 | | |
1290 | 1290 | | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
1291 | 1295 | | |
1292 | 1296 | | |
1293 | 1297 | | |
| |||
1386 | 1390 | | |
1387 | 1391 | | |
1388 | 1392 | | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
1389 | 1398 | | |
1390 | 1399 | | |
1391 | 1400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1429 | 1429 | | |
1430 | 1430 | | |
1431 | 1431 | | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
0 commit comments