File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1433,7 +1433,7 @@ trait Applications extends Compatibility {
14331433 .select(defn.newGenericArrayMethod).withSpan(tree.span)
14341434 .appliedToTypeTrees(targs).appliedToTermArgs(args)
14351435
1436- if ( TypeErasure .isGeneric(targ.tpe))
1436+ if TypeErasure .isGeneric(targ.tpe) || targ.tpe.derivesFrom(defn. ArrayClass ) then
14371437 newGenericArrayCall
14381438 else tree
14391439 case _ =>
Original file line number Diff line number Diff line change 1+ import scala .reflect .ClassTag
2+
3+ object MyArray :
4+ def empty [T : ClassTag ]: Array [Array [T ]] = new Array [Array [T ]](0 )
Original file line number Diff line number Diff line change 1+ @ main def Test =
2+ val arr : Array [Array [String ]] = MyArray .empty[String ]
3+ assert(arr.length == 0 )
You can’t perform that action at this time.
0 commit comments