Commit a11de49
committed
Fix #6460: less forcing in checkNonCyclic
checkNonCyclic was forcing too many infos because it didn't account for
the case where the prefix is a ModuleVal and not a ModuleClass. Fixing
this solves the incremental compilation issue in the Dotty build
reported in #6460 were the root cause was a completion cycle when
jointly compiling SymbolLoaders and Types that looked like this:
Complete `object tpd`
Complete its parent `Trees.Instance`
Complete its type parameter `T >: Untyped <: Type`
run `checkNonCyclic` on the the type parameter definition
Complete `Type`
Complete `import ast.tpd._` in `Types.scala`
Eventually this requires unpickling the selection `Trees.Instance#T` which
gets a `NoDenotation` since `T` hasn't been entered yet.
As a side-effect this also means that the neg/toplevel-cyclic
test no longer leads to an "illegal cyclic reference" error, instead it
now causes "recursion limit exceeded" errors, which are less nice but
still acceptable.1 parent 8b09bab commit a11de49
File tree
4 files changed
+12
-4
lines changed- compiler
- src/dotty/tools/dotc/typer
- test/dotty/tools/dotc
- tests/neg/toplevel-cyclic
4 files changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
| 243 | + | |
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| |||
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
52 | 60 | | |
53 | 61 | | |
54 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments