aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-03-21 18:39:35 +0100
committerMartin Odersky <odersky@gmail.com>2014-03-21 18:39:35 +0100
commit9b17c6c86f3150afa7b5b395c23ec3fdf9c14200 (patch)
tree61651354673a1fbbe2800d047e3dfd8211567af9 /src/dotty/tools/dotc/core/Types.scala
parent5f318bc925c227d2bce5cff31610803185b57f54 (diff)
downloaddotty-9b17c6c86f3150afa7b5b395c23ec3fdf9c14200.tar.gz
dotty-9b17c6c86f3150afa7b5b395c23ec3fdf9c14200.tar.bz2
dotty-9b17c6c86f3150afa7b5b395c23ec3fdf9c14200.zip
Fix of Fix of t1236: higher-kinded
Fix of d6df293d2120f2247198cb6646a23c338f7dcbbf. It turned out the original commit was faulty in that iterator.flatten did not typecheck. The problem is fixed in this commit and flatten is added to the collections test.
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