Commit b07f7b3
committed
[CS] Improve handling of holes for Named/AnyPatterns
Rather than eagerly binding them to holes if the
sequence element type ends up being Any, let's
record the CollectionElementContextualMismatch fix,
and then if the patterns end up becoming holes,
skip penalizing them if we know the fix was
recorded. This avoids prematurely turning type
variables for ExprPatterns into holes, which
should be able to get better bindings from the
expression provided. Also this means we'll apply
the logic to non-Any sequence types, which
previously we would give a confusing diagnostic
to.1 parent 1be2589 commit b07f7b3
File tree
7 files changed
+43
-22
lines changed- include/swift/Sema
- lib/Sema
- test/stmt
- validation-test/Sema/type_checker_crashers_fixed
7 files changed
+43
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
316 | 321 | | |
317 | 322 | | |
318 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2203 | 2203 | | |
2204 | 2204 | | |
2205 | 2205 | | |
2206 | | - | |
2207 | | - | |
2208 | | - | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
2209 | 2218 | | |
2210 | 2219 | | |
2211 | 2220 | | |
2212 | 2221 | | |
2213 | 2222 | | |
2214 | 2223 | | |
2215 | | - | |
| 2224 | + | |
2216 | 2225 | | |
2217 | 2226 | | |
2218 | 2227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2471 | 2471 | | |
2472 | 2472 | | |
2473 | 2473 | | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
2474 | 2477 | | |
2475 | 2478 | | |
2476 | 2479 | | |
| |||
2479 | 2482 | | |
2480 | 2483 | | |
2481 | 2484 | | |
2482 | | - | |
2483 | | - | |
| 2485 | + | |
| 2486 | + | |
2484 | 2487 | | |
2485 | 2488 | | |
2486 | 2489 | | |
| |||
2515 | 2518 | | |
2516 | 2519 | | |
2517 | 2520 | | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
2518 | 2524 | | |
2519 | 2525 | | |
2520 | | - | |
| 2526 | + | |
2521 | 2527 | | |
2522 | 2528 | | |
2523 | 2529 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6228 | 6228 | | |
6229 | 6229 | | |
6230 | 6230 | | |
6231 | | - | |
6232 | | - | |
6233 | | - | |
6234 | | - | |
6235 | | - | |
6236 | | - | |
6237 | | - | |
6238 | | - | |
6239 | | - | |
6240 | | - | |
6241 | 6231 | | |
6242 | 6232 | | |
6243 | 6233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
672 | 680 | | |
673 | 681 | | |
674 | 682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
22 | 20 | | |
0 commit comments