File tree 1 file changed +5
-3
lines changed
compiler/src/dotty/tools/dotc/transform
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -133,11 +133,13 @@ class IsInstanceOfEvaluator extends MiniPhaseTransform { thisTransformer =>
133
133
val selClassNonFinal = selClass && ! (selector.typeSymbol is Final )
134
134
val selFinalClass = selClass && (selector.typeSymbol is Final )
135
135
136
- /** Check if the selector's potential type parameters will be erased, and if so warn */
136
+ // Check if the selector's potential type parameters will be erased, and if so warn
137
137
val selTypeParam = tree.args.head.tpe.widen match {
138
138
case tp @ AppliedType (_, arg :: _) =>
139
- // If the type is `Array[X]` where `X` extends AnyVal
140
- val anyValArray = tp.isRef(defn.ArrayClass ) && arg.derivesFrom(defn.AnyValClass )
139
+ // If the type is `Array[X]` where `X` is a primitive value
140
+ // class. In the future, when we have a solid implementation of
141
+ // Arrays of value classes, we might be able to relax this check.
142
+ val anyValArray = tp.isRef(defn.ArrayClass ) && arg.typeSymbol.isPrimitiveValueClass
141
143
// param is: Any | AnyRef | java.lang.Object
142
144
val topType = defn.ObjectType <:< arg
143
145
// has @unchecked annotation to suppress warnings
You can’t perform that action at this time.
0 commit comments