aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index e9c3c56b2..7cd66f5dd 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -1926,7 +1926,10 @@ object Types {
if (lo eq tp) this
else TypeAlias(tp, variance)
- def contains(tp: Type)(implicit ctx: Context) = lo <:< tp && tp <:< hi
+ def contains(tp: Type)(implicit ctx: Context) = tp match {
+ case tp: TypeBounds => lo <:< tp.lo && tp.hi <:< hi
+ case _ => lo <:< tp && tp <:< hi
+ }
def & (that: TypeBounds)(implicit ctx: Context): TypeBounds = {
val v = this commonVariance that