File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -453,10 +453,11 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
453
453
* kind for the given element type in `elemTpe`.
454
454
*/
455
455
def wrapArray (tree : Tree , elemtp : Type )(implicit ctx : Context ): Tree =
456
- ref(defn.getWrapVarargsArrayModule)
456
+ val wrapper = ref(defn.getWrapVarargsArrayModule)
457
457
.select(wrapArrayMethodName(elemtp))
458
458
.appliedToTypes(if (elemtp.isPrimitiveValueType) Nil else elemtp :: Nil )
459
- .appliedTo(tree)
459
+ val actualElem = wrapper.tpe.widen.firstParamTypes.head
460
+ wrapper.appliedTo(tree.ensureConforms(actualElem))
460
461
461
462
// ------ Creating typed equivalents of trees that exist only in untyped form -------
462
463
Original file line number Diff line number Diff line change @@ -31,6 +31,6 @@ class SeqLiterals extends MiniPhase {
31
31
val arr = JavaSeqLiteral (tree.elems, tree.elemtpt)
32
32
// println(i"trans seq $tree, arr = $arr: ${arr.tpe} ${arr.tpe.elemType}")
33
33
val elemtp = tree.elemtpt.tpe
34
- wrapArray(arr, elemtp).withSpan(tree.span)
34
+ wrapArray(arr, elemtp).withSpan(tree.span).ensureConforms(tree.tpe)
35
35
}
36
36
}
You can’t perform that action at this time.
0 commit comments