aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-09-16 17:56:17 +0200
committerMartin Odersky <odersky@gmail.com>2013-09-16 17:56:17 +0200
commitdba4f1ec3dc5f489056284aab63c771cdd32561c (patch)
treeab6af09b871c2a01741fd5bbe874a1e19a3fddea /src/dotty/tools/dotc/core/Types.scala
parent682cf32cbe5cebeccf9ea10caf43e74c9cecc7c0 (diff)
downloaddotty-dba4f1ec3dc5f489056284aab63c771cdd32561c.tar.gz
dotty-dba4f1ec3dc5f489056284aab63c771cdd32561c.tar.bz2
dotty-dba4f1ec3dc5f489056284aab63c771cdd32561c.zip
Bug fixes and improvements in error diagnostics.
Main refactoring: lub/glb moves to type comparers.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 9c0a0ff49..36a4986b4 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -504,10 +504,10 @@ object Types {
}}
def & (that: Type)(implicit ctx: Context): Type =
- ctx.glb(this, that)
+ ctx.typeComparer.glb(this, that)
def | (that: Type)(implicit ctx: Context): Type =
- ctx.lub(this, that)
+ ctx.typeComparer.lub(this, that)
// ----- Unwrapping types -----------------------------------------------
@@ -1284,6 +1284,7 @@ object Types {
false
}
override def computeHash = doHash(fixedSym, prefix)
+ override def toString = super.toString + "(fixed sym)"
}
final class TermRefBySym(prefix: Type, name: TermName, val fixedSym: TermSymbol)
@@ -1762,7 +1763,6 @@ object Types {
/** Instantiate variable with given type */
def instantiateWith(tp: Type)(implicit ctx: Context): Type = {
assert(owningState.undetVars contains this)
- owningState.constraint -= origin
owningState.undetVars -= this
if (ctx.typerState eq creatorState) inst = tp
else ctx.typerState.instType = ctx.typerState.instType.updated(this, tp)
@@ -2010,7 +2010,7 @@ object Types {
object ErrorType extends ErrorType
/** Wildcard type, possibly with bounds */
- abstract case class WildcardType(optBounds: Type) extends CachedGroundType {
+ abstract case class WildcardType(optBounds: Type) extends CachedGroundType with TermType {
def derivedWildcardType(optBounds: Type)(implicit ctx: Context) =
if (optBounds eq this.optBounds) this else WildcardType(optBounds.asInstanceOf[TypeBounds])
override def computeHash = doHash(optBounds)