aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeComparer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-01-09 14:39:36 +0100
committerMartin Odersky <odersky@gmail.com>2015-01-09 14:39:36 +0100
commitee191f38efc9cd0ca05823499c1a8abf7883ff5e (patch)
treecfbd2ffbbf48952177fdaf98c26d873af4adb6eb /src/dotty/tools/dotc/core/TypeComparer.scala
parentf11a0a533dd628684f9d255df97c2af54664b103 (diff)
downloaddotty-ee191f38efc9cd0ca05823499c1a8abf7883ff5e.tar.gz
dotty-ee191f38efc9cd0ca05823499c1a8abf7883ff5e.tar.bz2
dotty-ee191f38efc9cd0ca05823499c1a8abf7883ff5e.zip
Made fast path for refined subtype checking configurable.
A configuratin now decides whether fast path is taken or not. That way we can more easily test either way if something goes wrong.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeComparer.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeComparer.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala
index 2b0391538..1d27f29a2 100644
--- a/src/dotty/tools/dotc/core/TypeComparer.scala
+++ b/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -340,7 +340,7 @@ class TypeComparer(initctx: Context) extends DotClass with Skolemization {
s"${tp1.show} <:< ${tp2.show}" +
(if (ctx.settings.verbose.value) s" ${tp1.getClass} ${tp2.getClass}${if (frozenConstraint) " frozen" else ""}" else "")
- def isSubType(tp1: Type, tp2: Type): Boolean = ctx.traceIndented(s"isSubType ${traceInfo(tp1, tp2)}, class1 = ${tp1.getClass}, class2 = ${tp2.getClass}", subtyping) /*<|<*/ {
+ def isSubType(tp1: Type, tp2: Type): Boolean = ctx.traceIndented(s"isSubType ${traceInfo(tp1, tp2)} ${if (Config.verboseExplainSubtype) s" ${tp1.getClass}, ${tp2.getClass}" else ""}", subtyping) /*<|<*/ {
if (tp2 eq NoType) false
else if (tp1 eq tp2) true
else {
@@ -622,7 +622,7 @@ class TypeComparer(initctx: Context) extends DotClass with Skolemization {
def compareRefined: Boolean = {
val tp1w = tp1.widen
val skipped2 = skipMatching(tp1w, tp2)
- if (skipped2 eq tp2) {
+ if ((skipped2 eq tp2) || !Config.fastPathForRefinedSubtype) {
val name2 = tp2.refinedName
val normalPath =
isSubType(tp1, tp2.parent) &&