aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-04-27 13:55:33 +0200
committerMartin Odersky <odersky@gmail.com>2016-04-27 14:01:41 +0200
commitc653a95ad4cfcaf881f77a6ab698945480b716e4 (patch)
tree3fec19d6e1ee11c28397fc678f9e1210621327ff /src
parent5e599cc14ac0dfe9f7b7605e537808c927e7a6a3 (diff)
downloaddotty-c653a95ad4cfcaf881f77a6ab698945480b716e4.tar.gz
dotty-c653a95ad4cfcaf881f77a6ab698945480b716e4.tar.bz2
dotty-c653a95ad4cfcaf881f77a6ab698945480b716e4.zip
Avoid forming ???.T type.
More generally, avoid forming a type selection on a term prefix which has a bottom class as a type. There might be other places where we have to take similar measures. For now, this one fixes #1235.
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/core/TypeComparer.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala
index a10b1fd0e..2523c6b9a 100644
--- a/src/dotty/tools/dotc/core/TypeComparer.scala
+++ b/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -715,7 +715,8 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
// val foo: C
// foo.type <: C { type T = foo.T }
rinfo2 match {
- case rinfo2: TypeAlias => (base select name) =:= rinfo2.alias
+ case rinfo2: TypeAlias =>
+ !defn.isBottomType(base.widen) && (base select name) =:= rinfo2.alias
case _ => false
}
}