aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-11-22 13:42:09 +0100
committerMartin Odersky <odersky@gmail.com>2013-11-22 13:42:09 +0100
commitb14291436172bf53cb40fdd2e94491e36a7da115 (patch)
tree67bb0321df0960ba283fc685b0233f0cebaa145c /src/dotty/tools/dotc/core/Types.scala
parente38813ac1362a1d528dfa1ee79f0f8b0d6f7ccb8 (diff)
downloaddotty-b14291436172bf53cb40fdd2e94491e36a7da115.tar.gz
dotty-b14291436172bf53cb40fdd2e94491e36a7da115.tar.bz2
dotty-b14291436172bf53cb40fdd2e94491e36a7da115.zip
Dropping cinsistency checking logic from typerstates.
Because of the new typerstate design, we can enforce most invariants by design, or in a purely local manner. We can therefore drop the checkConsistent checks and replace them with much more lightweight assertions that make sure that only committable states are committed and only committable states can create typevars.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index f530ff986..8796b19ad 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -2032,12 +2032,10 @@ object Types {
case OrType(tp1, tp2) => isSingleton(tp1) & isSingleton(tp2)
case _ => false
}
- ctx.typerState.withCheckingDisabled {
- var inst = ctx.typeComparer.approximation(origin, fromBelow)
- if (fromBelow && isSingleton(inst) && !isSingleton(upperBound))
- inst = inst.widen
- instantiateWith(inst.simplified)
- }
+ var inst = ctx.typeComparer.approximation(origin, fromBelow)
+ if (fromBelow && isSingleton(inst) && !isSingleton(upperBound))
+ inst = inst.widen
+ instantiateWith(inst.simplified)
}
/** Unwrap to instance (if instantiated) or origin (if not), until result