aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-04-08 22:22:51 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-04-08 22:22:51 +0200
commit9a7a7b889c9ded58ceaefb90f6ee208c9d2ab534 (patch)
treebb30156964be6feb7dc0f63a214a9c7b42f50596 /src/dotty/tools/dotc/core/Types.scala
parent73e7181becbb2c7393d402c6234c4321d7f2704b (diff)
downloaddotty-9a7a7b889c9ded58ceaefb90f6ee208c9d2ab534.tar.gz
dotty-9a7a7b889c9ded58ceaefb90f6ee208c9d2ab534.tar.bz2
dotty-9a7a7b889c9ded58ceaefb90f6ee208c9d2ab534.zip
Refactor checking in NamedTypes.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala13
1 files changed, 4 insertions, 9 deletions
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
}