From 9a7a7b889c9ded58ceaefb90f6ee208c9d2ab534 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Wed, 8 Apr 2015 22:22:51 +0200 Subject: Refactor checking in NamedTypes. --- src/dotty/tools/dotc/core/Types.scala | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/dotty') diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index f8ae06a94..31567fee0 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1158,11 +1158,6 @@ object Types { private[this] var lastDenotation: Denotation = _ private[this] var lastSymbol: Symbol = _ private[this] var checkedPeriod = Nowhere - - /** Provided for debugging, can be used to intercept assignments of uncommon denotations - */ - private def checkDenot(d: Denotation)(implicit ctx: Context) = { - } // Invariants: // (1) checkedPeriod != Nowhere => lastDenotation != null @@ -1243,9 +1238,7 @@ object Types { // phase but a defined denotation earlier (e.g. a TypeRef to an abstract type // is undefined after erasure.) We need to be able to do time travel back and // forth also in these cases. - checkDenot(d) - lastDenotation = d - lastSymbol = d.symbol + setDenot(d) checkedPeriod = ctx.period } d @@ -1291,7 +1284,9 @@ object Types { if (Config.checkNoDoubleBindings) if (ctx.settings.YnoDoubleBindings.value) checkSymAssign(denot.symbol) - checkDenot(denot) + + // additional checks that intercept `denot` can be added here + lastDenotation = denot lastSymbol = denot.symbol } -- cgit v1.2.3