File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -128,8 +128,8 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
128128 if (tpe derivesFrom defn.SeqClass ) SeqLiteral (elems) else JavaSeqLiteral (elems)
129129
130130 def JavaSeqLiteral (elems : List [Tree ])(implicit ctx : Context ): SeqLiteral =
131- new untpd.JavaSeqLiteral (elems)
132- .withType(defn. ArrayClass .typeRef.appliedTo(ctx.typeComparer.lub(elems.tpes)))
131+ ta.assignType( new untpd.JavaSeqLiteral (elems), elems)
132+
133133
134134 def TypeTree (original : Tree )(implicit ctx : Context ): TypeTree =
135135 TypeTree (original.tpe, original)
Original file line number Diff line number Diff line change @@ -304,11 +304,14 @@ trait TypeAssigner {
304304 def assignType (tree : untpd.Throw )(implicit ctx : Context ) =
305305 tree.withType(defn.NothingType )
306306
307- def assignType (tree : untpd.SeqLiteral , elems : List [Tree ])(implicit ctx : Context ) = {
308- val ownType =
309- if (ctx.erasedTypes) defn.SeqType
310- else defn.SeqType .appliedTo(ctx.typeComparer.lub(elems.tpes).widen)
311- tree.withType(ownType)
307+ def assignType (tree : untpd.SeqLiteral , elems : List [Tree ])(implicit ctx : Context ) = tree match {
308+ case tree : JavaSeqLiteral =>
309+ tree.withType(defn.ArrayClass .typeRef.appliedTo(ctx.typeComparer.lub(elems.tpes)))
310+ case _ =>
311+ val ownType =
312+ if (ctx.erasedTypes) defn.SeqType
313+ else defn.SeqType .appliedTo(ctx.typeComparer.lub(elems.tpes).widen)
314+ tree.withType(ownType)
312315 }
313316
314317 def assignType (tree : untpd.SingletonTypeTree , ref : Tree )(implicit ctx : Context ) =
You can’t perform that action at this time.
0 commit comments