diff options
author | Martin Odersky <odersky@gmail.com> | 2013-11-14 17:50:10 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-11-14 18:05:41 +0100 |
commit | ffe9e2237956d167b51c9ab1e571a04163b525f7 (patch) | |
tree | 952d7177e26997df8761452844df0f375a3aae75 /src/dotty/tools/dotc/core/Types.scala | |
parent | fe865cd382bb21026b79070eafa597b865fe461c (diff) | |
download | dotty-ffe9e2237956d167b51c9ab1e571a04163b525f7.tar.gz dotty-ffe9e2237956d167b51c9ab1e571a04163b525f7.tar.bz2 dotty-ffe9e2237956d167b51c9ab1e571a04163b525f7.zip |
Some configuation parameters
Caching, plus whether we want to match on signatures or types.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 27e177de6..14ebba57d 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -22,6 +22,7 @@ import transform.Erasure import printing.Printer import scala.util.hashing.{ MurmurHash3 => hashing } import collection.mutable +import config.Config object Types { @@ -416,7 +417,7 @@ object Types { final def member(name: Name)(implicit ctx: Context): Denotation = track("member-" + name) { try findMember(name, widenIfUnstable, EmptyFlags) catch { - case ex: Throwable => println(s"error occurred during: $this member $name"); throw ex // DEBUG + case ex: Throwable => println(s"error occurred during: $this: ${this.widen} member $name"); throw ex // DEBUG } } @@ -572,10 +573,12 @@ object Types { * - Or phase.erasedTypes is false and both types are neither method nor * poly types. */ - def matches(that: Type)(implicit ctx: Context): Boolean = track("matches") { - ctx.typeComparer.matchesType( - this, that, alwaysMatchSimple = !ctx.phase.erasedTypes) - } + def matches(that: Type)(implicit ctx: Context): Boolean = + if (Config.newMatch) this.signature == that.signature + else track("matches") { + ctx.typeComparer.matchesType( + this, that, alwaysMatchSimple = !ctx.phase.erasedTypes) + } /** The non-private symbol with given name in the given class that matches this type. * @param inClass The class containing the symbol's definition |