diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-09-30 16:46:46 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-09-30 16:46:46 +1000 |
commit | 8c9482108d2c4db73a22a6fb3f3660f168a174e9 (patch) | |
tree | 781070c922e55e113e0855b6dac0a94017e8c1d3 /src/compiler/scala/tools/nsc/typechecker/Namers.scala | |
parent | fbdfc83b5f0b3a2d2962c1adad8875a7e58d6497 (diff) | |
download | scala-8c9482108d2c4db73a22a6fb3f3660f168a174e9.tar.gz scala-8c9482108d2c4db73a22a6fb3f3660f168a174e9.tar.bz2 scala-8c9482108d2c4db73a22a6fb3f3660f168a174e9.zip |
SI-9498 Centralize and bolster TypeRef cache invalidation
I found another spot where I had previously needed to manually
invalidate a TypeRef cache, and modified that to route through
the newly added `invalidatedCaches`.
`invalidatedCaches` now invalidates all the other caches I could
find in our types of types. I opted for a non-OO approach here,
as we've got a fairly intricate lattice of traits in place that
define caches, and I didn't have the stomach for adding a polymorphic
`Type::invalidatedCaches` with the the right sprinkling over overrides
and super calls.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index 254cb7111c..ba095c808e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -163,13 +163,9 @@ trait Namers extends MethodSynthesis { def updatePosFlags(sym: Symbol, pos: Position, flags: Long): Symbol = { debuglog("[overwrite] " + sym) val newFlags = (sym.flags & LOCKED) | flags - sym.rawInfo match { - case tr: TypeRef => - // !!! needed for: pos/t5954d; the uniques type cache will happily serve up the same TypeRef - // over this mutated symbol, and we witness a stale cache for `parents`. - tr.invalidateCaches() - case _ => - } + // !!! needed for: pos/t5954d; the uniques type cache will happily serve up the same TypeRef + // over this mutated symbol, and we witness a stale cache for `parents`. + invalidateCaches(sym.rawInfo, sym :: sym.moduleClass :: Nil) sym reset NoType setFlag newFlags setPos pos sym.moduleClass andAlso (updatePosFlags(_, pos, moduleClassFlags(flags))) |