aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-02-24 11:52:57 +0100
committerMartin Odersky <odersky@gmail.com>2014-02-24 18:56:48 +0100
commit91e74ee45c8cedac279ec66f8277c94d05f2f2e3 (patch)
tree988e65878c5f7a891288486d1e20da751283c18a /src/dotty/tools/dotc/core/Types.scala
parent23969f6e10a16b51d23c3da3f29b4f7edaef6e5a (diff)
downloaddotty-91e74ee45c8cedac279ec66f8277c94d05f2f2e3.tar.gz
dotty-91e74ee45c8cedac279ec66f8277c94d05f2f2e3.tar.bz2
dotty-91e74ee45c8cedac279ec66f8277c94d05f2f2e3.zip
Performance improvement: Streamline successful toplevel subtype checks
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index c1d3de582..00d719acb 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -466,7 +466,7 @@ object Types {
/** Is this type a subtype of that type? */
final def <:<(that: Type)(implicit ctx: Context): Boolean = track("<:<") {
- ctx.typeComparer.isSubType(this, that)
+ ctx.typeComparer.topLevelSubType(this, that)
}
/** Is this type the same as that type?
@@ -2263,21 +2263,6 @@ object Types {
case SuperType(thistp, supertp) =>
this(this(x, thistp), supertp)
- case bounds @ TypeBounds(lo, hi) =>
- if (lo eq hi) {
- val saved = variance
- variance = variance * bounds.variance
- val result = this(x, lo)
- variance = saved
- result
- }
- else {
- variance = -variance
- val y = this(x, lo)
- variance = -variance
- this(y, hi)
- }
-
case tp @ ClassInfo(prefix, _, _, _, _) =>
this(x, prefix)