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 0cd96ae commit 6d93b8bCopy full SHA for 6d93b8b
src/dotty/tools/dotc/transform/IsInstanceOfEvaluator.scala
@@ -82,7 +82,7 @@ class IsInstanceOfEvaluator extends MiniPhaseTransform { thisTransformer =>
82
* `srutinee.isInstanceOf[Selector]` if `scrutinee eq null`
83
*/
84
def rewrite(tree: Select, to: Boolean): Tree =
85
- if (!to || tree.qualifier.tpe.widen.isPrimitiveValueType)
+ if (!to || !tree.qualifier.tpe.widen.derivesFrom(defn.AnyRefAlias))
86
Literal(Constant(to))
87
else
88
Apply(tree.qualifier.select(defn.Object_ne), List(Literal(Constant(null))))
0 commit comments