Skip to content

Commit 58615af

Browse files
committed
Revert implementation of stableInRunSymbol
It did not do the same thing at all in the new scheme.
1 parent 8a73734 commit 58615af

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,8 +1563,14 @@ object Types {
15631563
case _ => if (denotationIsCurrent) lastDenotation.symbol else NoSymbol
15641564
}
15651565

1566-
override protected[Types] def stableInRunSymbol(implicit ctx: Context): Symbol =
1567-
currentSymbol // ### todo: drop
1566+
/** Retrieves currently valid symbol without necessarily updating denotation.
1567+
* Assumes that symbols do not change between periods in the same run.
1568+
* Used to get the class underlying a ThisType.
1569+
*/
1570+
override protected[Types] def stableInRunSymbol(implicit ctx: Context): Symbol = {
1571+
if (checkedPeriod.runId == ctx.runId) lastSymbol
1572+
else symbol
1573+
}
15681574

15691575
private def lastKnownSymbol =
15701576
if (lastDenotation != null) lastDenotation.symbol else NoSymbol

0 commit comments

Comments
 (0)