aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-08-09 17:53:20 +0200
committerMartin Odersky <odersky@gmail.com>2013-08-09 17:53:20 +0200
commit2fffa023502cbaffe0e282495e18aefe2bff0d22 (patch)
tree006358958080a55ff7f156443faeb33c22d767c3 /src/dotty/tools/dotc/typer/Typer.scala
parent73525ada82375ef0ff4be61a3bfbae8c74963ad0 (diff)
downloaddotty-2fffa023502cbaffe0e282495e18aefe2bff0d22.tar.gz
dotty-2fffa023502cbaffe0e282495e18aefe2bff0d22.tar.bz2
dotty-2fffa023502cbaffe0e282495e18aefe2bff0d22.zip
Typing of SeqLiterals
Also revised handling of SeqLiterals by replacing additional type member with split into SeqLiteral and JavaSeqLiteral.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 5712dddcb..7995da312 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -533,6 +533,12 @@ class Typer extends Namer with Applications with Implicits {
cpy.Throw(tree, expr1) withType defn.NothingType
}
+ def typedSeqLiteral(tree: untpd.SeqLiteral, pt: Type)(implicit ctx: Context): SeqLiteral = {
+ val proto1 = pt.elemType orElse WildcardType
+ val elems1 = tree.elems map (typed(_, proto1))
+ cpy.SeqLiteral(tree, elems1) withType ctx.lub(elems1.tpes)
+ }
+
def typedBind(tree: untpd.Bind, pt: Type)(implicit ctx: Context): Bind = {
val body1 = typed(tree.body, pt)
val sym = ctx.newSymbol(ctx.owner, tree.name.asTermName, EmptyFlags, pt, coord = tree.pos)