Commit 5c077f0
Don't approximate a type using
Approximate range(Nothing, hi) to Nothing & hi instead of Nothing. This avoids
creating TypeRefs with a Nothing prefix which manifest themselves down the line
with an error like:
Cannot resolve reference to type path.type.AbsMember.
The classfile defining the type might be missing from the classpath.
val z1 = transition(di).ext(1) // error
^
Due to a MissingType thrown from TypeErasure#sigName.
This change required tweaking Type#findMember to handle WildcardTypes instead of
returning NoDenotation. This was only required for two
tests (tests/pos/i7414.scala and tests/pos/i13842.scala) where `wildApprox` ends
up creating a TermRef whose underlying type is a WildcardType, because of a type
parameter being substituted by a wildcard, which seems legitimate when we're using
`wildApprox`.
The presentation compiler also had a special case for Nothing appearing in
completion which had to be adapted.
Fixes scala#23530
[Cherry-picked 9f4179a]Nothing as prefix1 parent 732c3a6 commit 5c077f0
File tree
3 files changed
+41
-8
lines changed- compiler/src/dotty/tools/dotc/core
- presentation-compiler/src/main/dotty/tools/pc/printer
- tests/pos
3 files changed
+41
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
792 | 792 | | |
793 | 793 | | |
794 | 794 | | |
| 795 | + | |
| 796 | + | |
795 | 797 | | |
796 | 798 | | |
797 | 799 | | |
| |||
6052 | 6054 | | |
6053 | 6055 | | |
6054 | 6056 | | |
6055 | | - | |
6056 | | - | |
6057 | | - | |
| 6057 | + | |
| 6058 | + | |
| 6059 | + | |
| 6060 | + | |
| 6061 | + | |
| 6062 | + | |
| 6063 | + | |
| 6064 | + | |
| 6065 | + | |
| 6066 | + | |
| 6067 | + | |
| 6068 | + | |
| 6069 | + | |
| 6070 | + | |
| 6071 | + | |
| 6072 | + | |
| 6073 | + | |
| 6074 | + | |
6058 | 6075 | | |
6059 | 6076 | | |
6060 | 6077 | | |
| |||
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
254 | 253 | | |
255 | 254 | | |
256 | 255 | | |
257 | | - | |
258 | 256 | | |
259 | 257 | | |
260 | 258 | | |
| |||
496 | 494 | | |
497 | 495 | | |
498 | 496 | | |
499 | | - | |
| 497 | + | |
500 | 498 | | |
501 | | - | |
| 499 | + | |
502 | 500 | | |
503 | 501 | | |
504 | 502 | | |
| |||
| 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 | + | |
0 commit comments