aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeComparer.scala
diff options
context:
space:
mode:
authorNicolas Stucki <nicolas.stucki@gmail.com>2016-11-15 16:56:40 +0100
committerNicolas Stucki <nicolas.stucki@gmail.com>2016-11-17 10:09:08 +0100
commitf68058c02db32f33ccbd53a9e1ca346701a72abb (patch)
tree817e7dc22f878051be25c347bd42242b5ccb7ec9 /src/dotty/tools/dotc/core/TypeComparer.scala
parent2d18af61581696efe0e2869472c9d4214370cc9f (diff)
downloaddotty-f68058c02db32f33ccbd53a9e1ca346701a72abb.tar.gz
dotty-f68058c02db32f33ccbd53a9e1ca346701a72abb.tar.bz2
dotty-f68058c02db32f33ccbd53a9e1ca346701a72abb.zip
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.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeComparer.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeComparer.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala
index 1980fe50d..0e1d373a8 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)