aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-05-04 21:20:38 +0200
committerMartin Odersky <odersky@gmail.com>2015-05-04 21:20:47 +0200
commit6780dbd0a66fdaec6a7be2faac78620e8922cbd4 (patch)
tree136404b6503bc36ff23d6ed7728e0143987dccf3 /src/dotty/tools/dotc/core/Types.scala
parentcfa2ba030becec1f0e12994f120b65ca5e99badb (diff)
downloaddotty-6780dbd0a66fdaec6a7be2faac78620e8922cbd4.tar.gz
dotty-6780dbd0a66fdaec6a7be2faac78620e8922cbd4.tar.bz2
dotty-6780dbd0a66fdaec6a7be2faac78620e8922cbd4.zip
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.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala4
1 files changed, 1 insertions, 3 deletions
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}")