Commit 3729960
committed
Fix signature caching involving type variables
Signatures should not be cached if they may change. The existing
`isUnderDefined` check is not enough to guarantee this because the signature
might have been computed based on a type variable instantiated in a TyperState
which was subsequently retracted.
To guard against this, we now rely on `Type#isProvisional`. This is a stricter
check than needed since the provisional part of the type does not always have
an impact on its signature, but in practice this is fine: when compiling Dotty,
signature cache misses increased by less than 2%.1 parent c21133f commit 3729960
File tree
2 files changed
+41
-4
lines changed- compiler
- src/dotty/tools/dotc/core
- test/dotty/tools
2 files changed
+41
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2272 | 2272 | | |
2273 | 2273 | | |
2274 | 2274 | | |
2275 | | - | |
| 2275 | + | |
2276 | 2276 | | |
2277 | 2277 | | |
2278 | 2278 | | |
| |||
3784 | 3784 | | |
3785 | 3785 | | |
3786 | 3786 | | |
3787 | | - | |
| 3787 | + | |
3788 | 3788 | | |
3789 | 3789 | | |
3790 | 3790 | | |
3791 | 3791 | | |
3792 | | - | |
| 3792 | + | |
3793 | 3793 | | |
3794 | 3794 | | |
3795 | 3795 | | |
3796 | 3796 | | |
3797 | | - | |
| 3797 | + | |
3798 | 3798 | | |
3799 | 3799 | | |
3800 | 3800 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
0 commit comments