Skip to content

Commit 423ef59

Browse files
committed
Fix case process
1 parent 2a8cc49 commit 423ef59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,8 +812,8 @@ trait Implicits { self: Typer =>
812812
cmpWithBoxed(cls1, cls2)
813813
else if (cls2.isPrimitiveValueClass)
814814
cmpWithBoxed(cls2, cls1)
815-
else if (cls1 == defn.NullClass)
816-
cls1 == cls2
815+
else if (cls1 == defn.NullClass && cls1 == cls2)
816+
true
817817
else if (!ctx.explicitNulls)
818818
// If explicit nulls is enabled, we want to disallow comparison between Object and Null.
819819
// If a nullable value has a non-nullable type, we can still cast it to nullable type

0 commit comments

Comments
 (0)