aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/TypeAssigner.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/typer/TypeAssigner.scala')
-rw-r--r--src/dotty/tools/dotc/typer/TypeAssigner.scala13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/typer/TypeAssigner.scala b/src/dotty/tools/dotc/typer/TypeAssigner.scala
index 765c6bea7..6c5e48edb 100644
--- a/src/dotty/tools/dotc/typer/TypeAssigner.scala
+++ b/src/dotty/tools/dotc/typer/TypeAssigner.scala
@@ -323,11 +323,14 @@ trait TypeAssigner {
def assignType(tree: untpd.Throw)(implicit ctx: Context) =
tree.withType(defn.NothingType)
- def assignType(tree: untpd.SeqLiteral, elems: List[Tree])(implicit ctx: Context) = {
- val ownType =
- if (ctx.erasedTypes) defn.SeqType
- else defn.SeqType.appliedTo(ctx.typeComparer.lub(elems.tpes).widen)
- tree.withType(ownType)
+ def assignType(tree: untpd.SeqLiteral, elems: List[Tree])(implicit ctx: Context) = tree match {
+ case tree: JavaSeqLiteral =>
+ tree.withType(defn.ArrayClass.typeRef.appliedTo(ctx.typeComparer.lub(elems.tpes)))
+ case _ =>
+ val ownType =
+ if (ctx.erasedTypes) defn.SeqType
+ else defn.SeqType.appliedTo(ctx.typeComparer.lub(elems.tpes).widen)
+ tree.withType(ownType)
}
def assignType(tree: untpd.SingletonTypeTree, ref: Tree)(implicit ctx: Context) =