aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/TreeInfo.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-04-24 18:04:09 +0200
committerMartin Odersky <odersky@gmail.com>2015-04-24 18:04:09 +0200
commit6a3aab8241cc5379bcffb7644bdbaa04ba12ce5b (patch)
tree80d4fa10baf4b1530963b2366fa4c420e68adeb4 /src/dotty/tools/dotc/ast/TreeInfo.scala
parent1e9c012a0c61b2031ecaf11de3f2e99a5fdff7af (diff)
downloaddotty-6a3aab8241cc5379bcffb7644bdbaa04ba12ce5b.tar.gz
dotty-6a3aab8241cc5379bcffb7644bdbaa04ba12ce5b.tar.bz2
dotty-6a3aab8241cc5379bcffb7644bdbaa04ba12ce5b.zip
Allow byname repated parameters
Implements #499
Diffstat (limited to 'src/dotty/tools/dotc/ast/TreeInfo.scala')
-rw-r--r--src/dotty/tools/dotc/ast/TreeInfo.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/ast/TreeInfo.scala b/src/dotty/tools/dotc/ast/TreeInfo.scala
index a7f89337c..1ba7acb48 100644
--- a/src/dotty/tools/dotc/ast/TreeInfo.scala
+++ b/src/dotty/tools/dotc/ast/TreeInfo.scala
@@ -160,11 +160,12 @@ trait TreeInfo[T >: Untyped <: Type] { self: Trees.Instance[T] =>
case _ => Nil
}
- /** Is tpt a vararg type of the form T* ? */
- def isRepeatedParamType(tpt: Tree)(implicit ctx: Context) = tpt match {
+ /** Is tpt a vararg type of the form T* or => T*? */
+ def isRepeatedParamType(tpt: Tree)(implicit ctx: Context): Boolean = tpt match {
+ case ByNameTypeTree(tpt1) => isRepeatedParamType(tpt1)
case tpt: TypeTree => tpt.typeOpt.isRepeatedParam
- case AppliedTypeTree(Select(_, tpnme.REPEATED_PARAM_CLASS), _) => true
- case _ => false
+ case AppliedTypeTree(Select(_, tpnme.REPEATED_PARAM_CLASS), _) => true
+ case _ => false
}
/** Is name a left-associative operator? */