Skip to content

Commit 136b0ce

Browse files
committed
Set incomplete rootTreeOrProvider in typer
During typer, set `rootTreeOrProvider` to be the typed class def. This information will be overwritten in `SetRootTree` to include the whole package structure, but we may never reach this phase.
1 parent aa10ba7 commit 136b0ce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,6 +1642,12 @@ class Typer extends Namer
16421642
// check value class constraints
16431643
checkDerivedValueClass(cls, body1)
16441644

1645+
1646+
// Temporarily set the typed class def as root tree so that we have at least some
1647+
// information in the IDE in case we never reach `SetRootTree`.
1648+
if (ctx.mode.is(Mode.Interactive) && ctx.settings.YretainTrees.value)
1649+
cls.rootTreeOrProvider = cdef1
1650+
16451651
cdef1
16461652

16471653
// todo later: check that

0 commit comments

Comments
 (0)