aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/Desugar.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-04-21 18:10:25 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-05-08 21:51:46 +0200
commit782c24ff51865e43e34a2485dc585a757ada2c3b (patch)
treeb4aab29f24af18dd4ab428c2e8169cf8fc320be2 /src/dotty/tools/dotc/ast/Desugar.scala
parent35366df3bed1e2a13aa41abfd0f75c7241f22197 (diff)
downloaddotty-782c24ff51865e43e34a2485dc585a757ada2c3b.tar.gz
dotty-782c24ff51865e43e34a2485dc585a757ada2c3b.tar.bz2
dotty-782c24ff51865e43e34a2485dc585a757ada2c3b.zip
Changed handling of repeated parameters.
Previously, repeated parameters were typed as `<repeated>[T]`. The method `underlyingWithRepeated` converts `<repeated>[T]` to `Seq[T]`. This method was called in typedIdent, but the call was ineffective because the type of a repeated parameter ident is a TermRef. This led to a retyping error in Decorators.scala under -Ycheck:front. We now distinguish between the type of the internal parameter ValDef and the type of the parameter in the MethodType. The former has the type `Seq[T] @dotty.annotation.internal.repeated`, the latter has the type `<repeated>[T]`. The translation with `underlyingWithRepeated` thus becomes unneccessary.
Diffstat (limited to 'src/dotty/tools/dotc/ast/Desugar.scala')
-rw-r--r--src/dotty/tools/dotc/ast/Desugar.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/ast/Desugar.scala b/src/dotty/tools/dotc/ast/Desugar.scala
index 8d891b9d9..513dee2ff 100644
--- a/src/dotty/tools/dotc/ast/Desugar.scala
+++ b/src/dotty/tools/dotc/ast/Desugar.scala
@@ -751,7 +751,9 @@ object desugar {
makeBinop(l, op, r)
case PostfixOp(t, op) =>
if ((ctx.mode is Mode.Type) && op == nme.raw.STAR)
- AppliedTypeTree(ref(defn.RepeatedParamType), t)
+ Annotated(
+ New(ref(defn.RepeatedAnnot.typeRef), Nil :: Nil),
+ AppliedTypeTree(ref(defn.SeqClass.typeRef), t))
else {
assert(ctx.mode.isExpr, ctx.mode)
Select(t, op)