File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -238,10 +238,11 @@ object TypeTestsCasts {
238238 constant(expr, Literal (Constant (false )))
239239 }
240240 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)
241+ foundClsSyms match
242+ case List (cls) if cls.isPrimitiveValueClass =>
243+ constant(expr, Literal (Constant (foundClsSyms.head == testCls)))
244+ case _ =>
245+ transformIsInstanceOf(expr, defn.boxedType(testCls.typeRef), flagUnrelated)
245246 else
246247 derivedTree(expr, defn.Any_isInstanceOf , testType)
247248 }
You can’t perform that action at this time.
0 commit comments