Commit ac74982
authored
Refine AsSeenFrom approximation scheme (#15957)
The previous scheme did not set the approximated flag in some cases, which led
to the appearance of unhelpful Nothing types in error messages.
We now always mark the AsSeenFrom map as approximated when encountering an illegal prefix at variance <= 0.
But we reset it again when a range in a prefix is dropped because we can follow a type alias or use a
singleton type info.
Furthermore, we use an `Int`, `approxCount` instead of `approximated` to keep track of
multiple approximation points.
Fixes #15939 in the sense that the error message now makes more sense. We still cannot find the implicit conversion; that would require a more global measure to fix the problem (such as going to ANF) or existential types.File tree
4 files changed
+95
-22
lines changed- compiler/src/dotty/tools/dotc/core
- tests/neg
4 files changed
+95
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 85 | + | |
| 86 | + | |
90 | 87 | | |
91 | 88 | | |
92 | 89 | | |
| |||
119 | 116 | | |
120 | 117 | | |
121 | 118 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
126 | 123 | | |
127 | 124 | | |
128 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5766 | 5766 | | |
5767 | 5767 | | |
5768 | 5768 | | |
| 5769 | + | |
| 5770 | + | |
| 5771 | + | |
| 5772 | + | |
| 5773 | + | |
| 5774 | + | |
| 5775 | + | |
5769 | 5776 | | |
5770 | 5777 | | |
5771 | 5778 | | |
| |||
5789 | 5796 | | |
5790 | 5797 | | |
5791 | 5798 | | |
5792 | | - | |
| 5799 | + | |
5793 | 5800 | | |
5794 | 5801 | | |
5795 | 5802 | | |
5796 | 5803 | | |
5797 | 5804 | | |
5798 | 5805 | | |
5799 | 5806 | | |
5800 | | - | |
| 5807 | + | |
5801 | 5808 | | |
5802 | 5809 | | |
5803 | 5810 | | |
| |||
5813 | 5820 | | |
5814 | 5821 | | |
5815 | 5822 | | |
5816 | | - | |
| 5823 | + | |
5817 | 5824 | | |
5818 | 5825 | | |
5819 | | - | |
| 5826 | + | |
5820 | 5827 | | |
5821 | 5828 | | |
5822 | 5829 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
0 commit comments