Skip to content

Commit a9a8124

Browse files
committed
Simplification in type assigning SeqLiterals
1 parent 95ffe46 commit a9a8124

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
129129
def JavaSeqLiteral(elems: List[Tree])(implicit ctx: Context): SeqLiteral =
130130
ta.assignType(new untpd.JavaSeqLiteral(elems), elems)
131131

132-
133132
def TypeTree(original: Tree)(implicit ctx: Context): TypeTree =
134133
TypeTree(original.tpe, original)
135134

src/dotty/tools/dotc/typer/TypeAssigner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ trait TypeAssigner {
324324

325325
def assignType(tree: untpd.SeqLiteral, elems: List[Tree])(implicit ctx: Context) = tree match {
326326
case tree: JavaSeqLiteral =>
327-
tree.withType(defn.ArrayClass.typeRef.appliedTo(ctx.typeComparer.lub(elems.tpes)))
327+
tree.withType(defn.ArrayType(ctx.typeComparer.lub(elems.tpes).widen))
328328
case _ =>
329329
val ownType =
330330
if (ctx.erasedTypes) defn.SeqType

0 commit comments

Comments
 (0)