summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/TreeInfo.scala
diff options
context:
space:
mode:
authorJakob Odersky <jakob@odersky.com>2016-08-11 09:29:09 -0700
committerJakob Odersky <jakob@odersky.com>2016-08-11 11:18:09 -0700
commit708dd680b3e28c6344c3f45c2aea09cf1d3b5908 (patch)
treef302ec1fa9bdeb254be907aae06961120c0be808 /src/compiler/scala/tools/nsc/ast/TreeInfo.scala
parentd59de7d571c503064d3d2ad0db3312b9e6793616 (diff)
downloadscala-708dd680b3e28c6344c3f45c2aea09cf1d3b5908.tar.gz
scala-708dd680b3e28c6344c3f45c2aea09cf1d3b5908.tar.bz2
scala-708dd680b3e28c6344c3f45c2aea09cf1d3b5908.zip
move DocDef unwrapping to scala.tools.nsc.ast.TreeInfo
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/TreeInfo.scala')
-rw-r--r--src/compiler/scala/tools/nsc/ast/TreeInfo.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreeInfo.scala b/src/compiler/scala/tools/nsc/ast/TreeInfo.scala
index 689e6405d0..b78c5acc4f 100644
--- a/src/compiler/scala/tools/nsc/ast/TreeInfo.scala
+++ b/src/compiler/scala/tools/nsc/ast/TreeInfo.scala
@@ -97,4 +97,12 @@ abstract class TreeInfo extends scala.reflect.internal.TreeInfo {
case DocDef(_, definition) => isPureDef(definition)
case _ => super.isPureDef(tree)
}
+
+ override def firstConstructor(stats: List[Tree]): Tree = {
+ def unwrap(stat: Tree): Tree = stat match {
+ case DocDef(_, defn) => unwrap(defn)
+ case tree => tree
+ }
+ super.firstConstructor(stats map unwrap)
+ }
}