File tree 2 files changed +10
-7
lines changed 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 {
128
128
if (tpe derivesFrom defn.SeqClass ) SeqLiteral (elems) else JavaSeqLiteral (elems)
129
129
130
130
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
+
133
133
134
134
def TypeTree (original : Tree )(implicit ctx : Context ): TypeTree =
135
135
TypeTree (original.tpe, original)
Original file line number Diff line number Diff line change @@ -304,11 +304,14 @@ trait TypeAssigner {
304
304
def assignType (tree : untpd.Throw )(implicit ctx : Context ) =
305
305
tree.withType(defn.NothingType )
306
306
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)
312
315
}
313
316
314
317
def assignType (tree : untpd.SingletonTypeTree , ref : Tree )(implicit ctx : Context ) =
You can’t perform that action at this time.
0 commit comments