-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit 85ca5d1
Disable distribution of intersection types over applied types (#23441)
Fixes soundness issue #23435
Note in particular that this implies we cannot (indirectly) inherit
multiple instantiations of the same trait. E.g., see
[tests/neg/conflicting-inst-basetypes.scala](https://github.com/dotty-staging/dotty/blob/7bf9c7d442600eba0c583dc5161eeeae18577afe/tests/neg/conflicting-inst-basetypes.scala).
The impact on the community-build appears to be rather reasonable,
tweaks are required:
- In F-bounded parameters:
+
dotty-staging/zio@a7f6e1a...fee051a
+
dotty-staging/scala-parallel-collections@7d0e41a...3b978f9
- In places where inferred types were simplified with the faulty rule.
It seems unlikely that these were intentional usages of the distribution
rule, though.
+
dotty-staging/specs2@06c992d...b0652c3
+
dotty-staging/Lucre@21a27a2...5f2ca01
(has minimized test case included in the PR)
The changes should be relatively well regrouped by commit for review.File tree
34 files changed
+215
-102
lines changed- community-build/community-projects
- compiler/src/dotty/tools/dotc
- config
- core
- typer
- docs/_docs/reference/new-types
- tests
- neg-deep-subtype
- neg
- pos-macros
- pos
- reference
34 files changed
+215
-102
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
47 | + | ||
48 | + | ||
47 | 49 |
| |
48 | 50 |
| |
49 | 51 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
460 | 460 |
| |
461 | 461 |
| |
462 | 462 |
| |
463 | - | ||
463 | + | ||
464 | 464 |
| |
465 | 465 |
| |
466 | 466 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
307 | 307 |
| |
308 | 308 |
| |
309 | 309 |
| |
310 | - | ||
310 | + | ||
311 | 311 |
| |
312 | 312 |
| |
313 | 313 |
| |
| |||
325 | 325 |
| |
326 | 326 |
| |
327 | 327 |
| |
328 | - | ||
329 | - | ||
328 | + | ||
330 | 329 |
| |
331 | 330 |
| |
332 | 331 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
88 | 88 |
| |
89 | 89 |
| |
90 | 90 |
| |
91 | - | ||
91 | + | ||
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
|
Lines changed: 10 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 | + | ||
11 | 12 |
| |
12 | 13 |
| |
13 | 14 |
| |
| |||
475 | 476 |
| |
476 | 477 |
| |
477 | 478 |
| |
479 | + | ||
480 | + | ||
478 | 481 |
| |
479 | 482 |
| |
480 | 483 |
| |
481 | 484 |
| |
482 | 485 |
| |
483 | - | ||
484 | - | ||
486 | + | ||
487 | + | ||
488 | + | ||
489 | + | ||
490 | + | ||
491 | + | ||
492 | + | ||
485 | 493 |
| |
486 | 494 |
| |
487 | 495 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2460 | 2460 |
| |
2461 | 2461 |
| |
2462 | 2462 |
| |
2463 | - | ||
2463 | + | ||
2464 | + | ||
2464 | 2465 |
| |
2465 | 2466 |
| |
2466 | 2467 |
| |
| |||
2473 | 2474 |
| |
2474 | 2475 |
| |
2475 | 2476 |
| |
2476 | - | ||
2477 | - | ||
2477 | + | ||
2478 | + | ||
2479 | + | ||
2480 | + | ||
2478 | 2481 |
| |
2479 | 2482 |
| |
2480 | 2483 |
| |
| |||
2771 | 2774 |
| |
2772 | 2775 |
| |
2773 | 2776 |
| |
2774 | - | ||
2777 | + | ||
2775 | 2778 |
| |
2776 | 2779 |
| |
2777 | 2780 |
| |
| |||
2819 | 2822 |
| |
2820 | 2823 |
| |
2821 | 2824 |
| |
2822 | - | ||
2823 | - | ||
2825 | + | ||
2824 | 2826 |
| |
2825 | 2827 |
| |
2826 | 2828 |
| |
|
0 commit comments