diff options
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 9d692f39f..363e3006a 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1256,9 +1256,14 @@ object Types { private def checkSymAssign(sym: Symbol)(implicit ctx: Context) = assert( (lastSymbol eq sym) || - (lastSymbol eq null) || - (lastSymbol.defRunId != sym.defRunId) || - (lastSymbol.defRunId == NoRunId) || + (lastSymbol eq null) || { + val lastDefRunId = lastDenotation match { + case d: SymDenotation => d.validFor.runId + case _ => lastSymbol.defRunId + } + (lastDefRunId != sym.defRunId) || + (lastDefRunId == NoRunId) + } || (lastSymbol.infoOrCompleter == ErrorType || defn.overriddenBySynthetic.contains(lastSymbol) // for overriddenBySynthetic symbols a TermRef such as SomeCaseClass.this.hashCode |