Inconsistent null equality check scala 2.11.7
问题 Edit: This issue no longer exists in Scala 2.12.6 Original question (for Scala 2.11.7): Why so strange warning? scala> null.asInstanceOf[Double] res0: Double = 0.0 scala> null.asInstanceOf[Double] == null <console>:11: warning: comparing values of types Double and Null using `==' will always yield !!!!false!!!! null.asInstanceOf[Double] == null ^ res1: Boolean = true //!!!! scala> 0.0 == null <console>:11: warning: comparing values of types Double and Null using `==' will always yield false 0