Skip to content

Commit f68058c

Browse files
committed
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.
1 parent 2d18af6 commit f68058c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
527527
}
528528
isSubType(hi1, tp2) || compareGADT
529529
case _ =>
530-
def isNullable(tp: Type): Boolean = tp.dealias match {
530+
def isNullable(tp: Type): Boolean = tp.widenDealias match {
531531
case tp: TypeRef => tp.symbol.isNullableClass
532532
case tp: RefinedOrRecType => isNullable(tp.parent)
533533
case AndType(tp1, tp2) => isNullable(tp1) && isNullable(tp2)

0 commit comments

Comments
 (0)