From 6780dbd0a66fdaec6a7be2faac78620e8922cbd4 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 4 May 2015 21:20:38 +0200 Subject: Make data race detection more liberal. Allow to rebind a NmedType to refer to a symbol in a subclass of where the previous symbol was defined. This generalizes the previous rule that we allow to rebind from a root method to its synthetic implementation. The change is not necessary to make the new scheme of computeDenot pass the tests, but it seems useful to avoid spurious errors elsehere. --- src/dotty/tools/dotc/core/Types.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/core/Types.scala') diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 60255bd72..97e3f0390 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1283,9 +1283,7 @@ object Types { (lastDefRunId == NoRunId) } || (lastSymbol.infoOrCompleter == ErrorType || - defn.overriddenBySynthetic.contains(lastSymbol) - // for overriddenBySynthetic symbols a TermRef such as SomeCaseClass.this.hashCode - // might be rewritten from Object#hashCode to the hashCode generated at SyntheticMethods + sym.owner.derivesFrom(lastSymbol.owner) && sym.owner != lastSymbol.owner ), s"data race? overwriting symbol of ${this.show} / $this / ${this.getClass} / ${lastSymbol.id} / ${sym.id} / ${sym.owner} / ${lastSymbol.owner} / ${ctx.phase}") -- cgit v1.2.3