You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We had:
scala> null.isInstanceOf[String]
-- Warning: <console>:5:17 -----------------------------------------------------
5 |null.isInstanceOf[String]
|^^^^^^^^^^^^^^^^^^^^^^^^^
|this will always yield true if the scrutinee is non-null, since `Null` is a subclass of `String` (will be optimized away)
val res0: Boolean = true
scala> val x: AnyRef = null
val x: AnyRef = null
scala> x.isInstanceOf[String]
val res1: Boolean = false
Fixed by using `isNullable`.
0 commit comments