Skip to content

Commit d3e1eef

Browse files
committed
Make isStatic force less.
It's called in a lot of maps and forcing presents a risk of stale symbol errors. So we should force the minimum possible.
1 parent 4cb493a commit d3e1eef

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ object SymDenotations {
562562

563563
/** Is this denotation static (i.e. with no outer instance)? */
564564
final def isStatic(implicit ctx: Context) =
565-
(if (maybeOwner eq NoSymbol) isRoot else maybeOwner.isStaticOwner) ||
565+
(if (maybeOwner eq NoSymbol) isRoot else maybeOwner.originDenotation.isStaticOwner) ||
566566
myFlags.is(JavaStatic)
567567

568568
/** Is this a package class or module class that defines static symbols? */

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,10 @@ object Symbols {
435435
newd
436436
}
437437

438+
/** The original denotation of this symbol, without forcing anything */
439+
final def originDenotation: SymDenotation =
440+
lastDenot.initial
441+
438442
/** The last known denotation of this symbol, without going through `current` */
439443
final def lastKnownDenotation: SymDenotation =
440444
lastDenot

compiler/src/dotty/tools/dotc/printing/Printer.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
package dotty.tools.dotc
1+
package dotty.tools
2+
package dotc
23
package printing
34

45
import core._

0 commit comments

Comments
 (0)