From c653a95ad4cfcaf881f77a6ab698945480b716e4 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 27 Apr 2016 13:55:33 +0200 Subject: 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. --- src/dotty/tools/dotc/core/TypeComparer.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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 } } -- cgit v1.2.3