From f68058c02db32f33ccbd53a9e1ca346701a72abb Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Tue, 15 Nov 2016 16:56:40 +0100 Subject: [PATCH] Add warning on != with same type fix isNullable. Note that without the fix console tests will fail and without the warning there is no way to test the fix. --- src/dotty/tools/dotc/core/TypeComparer.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala index 1980fe50df91..0e1d373a86b9 100644 --- a/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/src/dotty/tools/dotc/core/TypeComparer.scala @@ -527,7 +527,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { } isSubType(hi1, tp2) || compareGADT case _ => - def isNullable(tp: Type): Boolean = tp.dealias match { + def isNullable(tp: Type): Boolean = tp.widenDealias match { case tp: TypeRef => tp.symbol.isNullableClass case tp: RefinedOrRecType => isNullable(tp.parent) case AndType(tp1, tp2) => isNullable(tp1) && isNullable(tp2)