We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a8cc49 commit 423ef59Copy full SHA for 423ef59
compiler/src/dotty/tools/dotc/typer/Implicits.scala
@@ -812,8 +812,8 @@ trait Implicits { self: Typer =>
812
cmpWithBoxed(cls1, cls2)
813
else if (cls2.isPrimitiveValueClass)
814
cmpWithBoxed(cls2, cls1)
815
- else if (cls1 == defn.NullClass)
816
- cls1 == cls2
+ else if (cls1 == defn.NullClass && cls1 == cls2)
+ true
817
else if (!ctx.explicitNulls)
818
// If explicit nulls is enabled, we want to disallow comparison between Object and Null.
819
// If a nullable value has a non-nullable type, we can still cast it to nullable type
0 commit comments