summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/TreeInfo.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-07-18 15:19:55 +0000
committerPaul Phillips <paulp@improving.org>2009-07-18 15:19:55 +0000
commit1c56489b3e008ffb192443a1627df16f245a6c01 (patch)
treeef14008ca66967f44c4eadaedb9f33c74d6a5b35 /src/compiler/scala/tools/nsc/ast/TreeInfo.scala
parent1f6c8f2be985dd24cb47dc1569d7980cf7a0fd2f (diff)
downloadscala-1c56489b3e008ffb192443a1627df16f245a6c01.tar.gz
scala-1c56489b3e008ffb192443a1627df16f245a6c01.tar.bz2
scala-1c56489b3e008ffb192443a1627df16f245a6c01.zip
Fix and post/neg test cases for #1878.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/TreeInfo.scala')
-rw-r--r--src/compiler/scala/tools/nsc/ast/TreeInfo.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreeInfo.scala b/src/compiler/scala/tools/nsc/ast/TreeInfo.scala
index 3d023777f3..3eb6dc321b 100644
--- a/src/compiler/scala/tools/nsc/ast/TreeInfo.scala
+++ b/src/compiler/scala/tools/nsc/ast/TreeInfo.scala
@@ -276,6 +276,18 @@ abstract class TreeInfo {
case _ => false
}
+ /** The underlying pattern ignoring any bindings */
+ def unbind(x: Tree): Tree = x match {
+ case Bind(_, y) => unbind(y)
+ case y => y
+ }
+
+ /** Is this tree a Star(_) after removing bindings? */
+ def isStar(x: Tree) = unbind(x) match {
+ case Star(_) => true
+ case _ => false
+ }
+
/** The method part of an application node
*/
def methPart(tree: Tree): Tree = tree match {