summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/TreeInfo.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-09-27 12:28:55 -0700
committerPaul Phillips <paulp@improving.org>2013-10-02 08:59:55 -0700
commitaced32d05c97651534f468bc9a475ea5f6ae75b8 (patch)
treefda8b628ae8501a8df945aeb7f558f259c857e62 /src/reflect/scala/reflect/internal/TreeInfo.scala
parent45183d8d28ff082d9186018b707f9fecb466f14f (diff)
downloadscala-aced32d05c97651534f468bc9a475ea5f6ae75b8.tar.gz
scala-aced32d05c97651534f468bc9a475ea5f6ae75b8.tar.bz2
scala-aced32d05c97651534f468bc9a475ea5f6ae75b8.zip
Removing unused code.
Most of this was revealed via -Xlint with a flag which assumes closed world. I can't see how to check the assumes-closed-world code in without it being an ordeal. I'll leave it in a branch in case anyone wants to finish the long slog to the merge.
Diffstat (limited to 'src/reflect/scala/reflect/internal/TreeInfo.scala')
-rw-r--r--src/reflect/scala/reflect/internal/TreeInfo.scala48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/reflect/scala/reflect/internal/TreeInfo.scala b/src/reflect/scala/reflect/internal/TreeInfo.scala
index 2f70b1950d..025965ad47 100644
--- a/src/reflect/scala/reflect/internal/TreeInfo.scala
+++ b/src/reflect/scala/reflect/internal/TreeInfo.scala
@@ -430,11 +430,6 @@ abstract class TreeInfo {
case _ => false
}
- def isEarlyTypeDef(tree: Tree) = tree match {
- case TypeDef(mods, _, _, _) => mods hasFlag PRESUPER
- case _ => false
- }
-
/** Is tpt a vararg type of the form T* ? */
def isRepeatedParamType(tpt: Tree) = tpt match {
case TypeTree() => definitions.isRepeatedParamType(tpt.tpe)
@@ -529,21 +524,6 @@ abstract class TreeInfo {
private def hasNoSymbol(t: Tree) = t.symbol == null || t.symbol == NoSymbol
- /** If this CaseDef assigns a name to its top-level pattern,
- * in the form 'expr @ pattern' or 'expr: pattern', returns
- * the name. Otherwise, nme.NO_NAME.
- *
- * Note: in the case of Constant patterns such as 'case x @ "" =>',
- * the pattern matcher eliminates the binding and inlines the constant,
- * so as far as this method is likely to be able to determine,
- * the name is NO_NAME.
- */
- def assignedNameOfPattern(cdef: CaseDef): Name = cdef.pat match {
- case Bind(name, _) => name
- case Ident(name) => name
- case _ => nme.NO_NAME
- }
-
/** Is this pattern node a synthetic catch-all case, added during PartialFuction synthesis before we know
* whether the user provided cases are exhaustive. */
def isSyntheticDefaultCase(cdef: CaseDef) = cdef match {
@@ -729,25 +709,6 @@ abstract class TreeInfo {
}
loop(tree)
}
-
- /** The depth of the nested applies: e.g. Apply(Apply(Apply(_, _), _), _)
- * has depth 3. Continues through type applications (without counting them.)
- */
- def applyDepth: Int = {
- def loop(tree: Tree): Int = tree match {
- case Apply(fn, _) => 1 + loop(fn)
- case TypeApply(fn, _) => loop(fn)
- case AppliedTypeTree(fn, _) => loop(fn)
- case _ => 0
- }
- loop(tree)
- }
-
- override def toString = {
- val tstr = if (targs.isEmpty) "" else targs.mkString("[", ", ", "]")
- val astr = argss map (args => args.mkString("(", ", ", ")")) mkString ""
- s"$core$tstr$astr"
- }
}
/** Returns a wrapper that knows how to destructure and analyze applications.
@@ -835,12 +796,6 @@ abstract class TreeInfo {
case _ => false
}
}
- object IsIf extends SeeThroughBlocks[Option[(Tree, Tree, Tree)]] {
- protected def unapplyImpl(x: Tree) = x match {
- case If(cond, thenp, elsep) => Some((cond, thenp, elsep))
- case _ => None
- }
- }
def isApplyDynamicName(name: Name) = (name == nme.updateDynamic) || (name == nme.selectDynamic) || (name == nme.applyDynamic) || (name == nme.applyDynamicNamed)
@@ -893,7 +848,4 @@ abstract class TreeInfo {
case Block(_, expr) => isMacroApplicationOrBlock(expr)
case tree => isMacroApplication(tree)
}
-
- def isNonTrivialMacroApplication(tree: Tree): Boolean =
- isMacroApplication(tree) && dissectApplied(tree).core != tree
}