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 3eb509b commit acc2b6cCopy full SHA for acc2b6c
compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala
@@ -238,10 +238,11 @@ object TypeTestsCasts {
238
constant(expr, Literal(Constant(false)))
239
}
240
else if (testCls.isPrimitiveValueClass)
241
- if (foundClsSyms.size == 1 && foundClsSyms.head.isPrimitiveValueClass)
242
- constant(expr, Literal(Constant(foundClsSyms.head == testCls)))
243
- else
244
- transformIsInstanceOf(expr, defn.boxedType(testCls.typeRef), flagUnrelated)
+ foundClsSyms match
+ case List(cls) if cls.isPrimitiveValueClass =>
+ constant(expr, Literal(Constant(foundClsSyms.head == testCls)))
+ case _ =>
245
+ transformIsInstanceOf(expr, defn.boxedType(testCls.typeRef), flagUnrelated)
246
else
247
derivedTree(expr, defn.Any_isInstanceOf, testType)
248
0 commit comments