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 @@ -126,8 +126,8 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
126
126
if (tpe derivesFrom defn.SeqClass ) SeqLiteral (elems) else JavaSeqLiteral (elems)
127
127
128
128
def JavaSeqLiteral (elems : List [Tree ])(implicit ctx : Context ): SeqLiteral =
129
- new untpd.JavaSeqLiteral (elems)
130
- .withType(defn. ArrayClass .typeRef.appliedTo(ctx.typeComparer.lub(elems.tpes)))
129
+ ta.assignType( new untpd.JavaSeqLiteral (elems), elems)
130
+
131
131
132
132
def TypeTree (original : Tree )(implicit ctx : Context ): TypeTree =
133
133
TypeTree (original.tpe, original)
Original file line number Diff line number Diff line change @@ -321,11 +321,14 @@ trait TypeAssigner {
321
321
def assignType (tree : untpd.Throw )(implicit ctx : Context ) =
322
322
tree.withType(defn.NothingType )
323
323
324
- def assignType (tree : untpd.SeqLiteral , elems : List [Tree ])(implicit ctx : Context ) = {
325
- val ownType =
326
- if (ctx.erasedTypes) defn.SeqType
327
- else defn.SeqType .appliedTo(ctx.typeComparer.lub(elems.tpes).widen)
328
- tree.withType(ownType)
324
+ def assignType (tree : untpd.SeqLiteral , elems : List [Tree ])(implicit ctx : Context ) = tree match {
325
+ case tree : JavaSeqLiteral =>
326
+ tree.withType(defn.ArrayClass .typeRef.appliedTo(ctx.typeComparer.lub(elems.tpes)))
327
+ case _ =>
328
+ val ownType =
329
+ if (ctx.erasedTypes) defn.SeqType
330
+ else defn.SeqType .appliedTo(ctx.typeComparer.lub(elems.tpes).widen)
331
+ tree.withType(ownType)
329
332
}
330
333
331
334
def assignType (tree : untpd.SingletonTypeTree , ref : Tree )(implicit ctx : Context ) =
You can’t perform that action at this time.
0 commit comments