- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
-Ytailrecommend
Wed, 2009-10-21, 23:14
The discovery of a stack overflow where the method only needed to be
tagged final to become overflow immune made me curious how many other
such places there are, so I added an option to find out. Turns out in
the compiler there are 77 more. This would be a lot more useful
cross-referenced with some runtime data like how often the method is
called or how deep the stack gets (anyone want a project?) but in case
anyone would like to sift, here is the compiler output.
You too can use -Ytailrecommend as of r19212.
The library output was a lot less exciting (in a good way) with only a
couple dozen hits and almost all of those in the XML lib.
scala/tools/nsc/ast/parser/Parsers.scala:233: warning: method is tailrecommended
def isWildcard(t: Tree): Boolean = t match {
^
scala/tools/nsc/ast/parser/Parsers.scala:630: warning: method is tailrecommended
def selectors(t: Tree, typeOK: Boolean, dotOffset: Int): Tree =
^
scala/tools/nsc/ast/parser/Parsers.scala:786: warning: method is tailrecommended
def infixTypeRest(t: Tree, isPattern: Boolean, mode: InfixMode.Value): Tree = {
^
scala/tools/nsc/ast/parser/Parsers.scala:868: warning: method is tailrecommended
def simpleTypeRest(t: Tree, isPattern: Boolean): Tree =
^
scala/tools/nsc/ast/parser/Parsers.scala:1231: warning: method is tailrecommended
def simpleExprRest(t: Tree, canApply: Boolean): Tree = {
^
scala/tools/nsc/ast/parser/TreeBuilder.scala:170: warning: method is tailrecommended
def makeNew(parents: List[Tree], self: ValDef, stats: List[Tree], argss: List[List[Tree]],
^
scala/tools/nsc/ast/TreeInfo.scala:47: warning: method is tailrecommended
def isInterfaceMember(tree: Tree): Boolean = tree match {
^
scala/tools/nsc/ast/TreeInfo.scala:59: warning: method is tailrecommended
def isPureDef(tree: Tree): Boolean = tree match {
^
scala/tools/nsc/ast/TreeInfo.scala:76: warning: method is tailrecommended
def isPureExpr(tree: Tree): Boolean = tree match {
^
scala/tools/nsc/ast/TreeInfo.scala:144: warning: method is tailrecommended
def firstConstructor(stats: List[Tree]): Tree = stats match {
^
scala/tools/nsc/ast/TreeInfo.scala:218: warning: method is tailrecommended
def mayBeTypePat(tree: Tree): Boolean = tree match {
^
scala/tools/nsc/ast/TreeInfo.scala:273: warning: method is tailrecommended
def isSequenceValued(tree: Tree): Boolean = tree match {
^
scala/tools/nsc/ast/TreeInfo.scala:282: warning: method is tailrecommended
def unbind(x: Tree): Tree = x match {
^
scala/tools/nsc/ast/TreeInfo.scala:295: warning: method is tailrecommended
def methPart(tree: Tree): Tree = tree match {
^
scala/tools/nsc/ast/TreeInfo.scala:313: warning: method is tailrecommended
def containsLeadingPredefImport(defs: List[Tree]): Boolean = defs match {
^
scala/tools/nsc/ast/TreePrinters.scala:40: warning: method is tailrecommended
def printSeq[a](ls: List[a])(printelem: a => Unit)(printsep: => Unit) {
^
scala/tools/nsc/ast/Trees.scala:225: warning: method is tailrecommended
def equalsStructure0(that: Tree)(f : (Tree,Tree) => Boolean): Boolean = {
^
scala/tools/nsc/ast/Trees.scala:1564: warning: method is tailrecommended
def traverse(tree: Tree): Unit = tree match {
^
scala/tools/nsc/backend/icode/Printers.scala:50: warning: method is tailrecommended
def printList[A](l: List[A], sep: String): Unit = l match {
^
scala/tools/nsc/backend/icode/Printers.scala:56: warning: method is tailrecommended
def printList[A](pr: A => Unit)(l: List[A], sep: String): Unit = l match {
^
scala/tools/nsc/backend/icode/TypeKinds.scala:424: warning: method is tailrecommended
def toTypeKind(t: Type): TypeKind = t match {
^
scala/tools/nsc/backend/msil/GenMSIL.scala:1161: warning: method is tailrecommended
def genBlocks(l: List[BasicBlock]) {
^
scala/tools/nsc/Global.scala:784: warning: method is tailrecommended
def compiles(sym: Symbol): Boolean =
^
scala/tools/nsc/Interpreter.scala:171: warning: method is tailrecommended
def apply(): String = {
^
scala/tools/nsc/InterpreterLoop.scala:330: warning: method is tailrecommended
def interpretStartingWith(code: String): Option[String] =
^
scala/tools/nsc/io/Process.scala:137: warning: method is tailrecommended
override def run() {
^
scala/tools/nsc/javac/JavaParsers.scala:248: warning: method is tailrecommended
def optArrayBrackets(tpt: Tree): Tree =
^
scala/tools/nsc/matching/MatrixAdditions.scala:27: warning: method is tailrecommended
def unapply(x: Tree): T = x match {
^
scala/tools/nsc/matching/MatrixAdditions.scala:54: warning: method is tailrecommended
override def traverse(tree: Tree) = tree match {
^
scala/tools/nsc/matching/Patterns.scala:444: warning: method is tailrecommended
protected def getPathSegments(t: Tree): List[Name] = t match {
^
scala/tools/nsc/models/Models.scala:56: warning: method is tailrecommended
def codeFor(kind: Kind): String = kind match {
^
scala/tools/nsc/models/Models.scala:389: warning: method is tailrecommended
def flatten(expr: Tree, filter: (Tree) => Boolean): List[Tree] =
^
scala/tools/nsc/models/SemanticTokens.scala:46: warning: method is tailrecommended
def eatKeyword(source: BatchSourceFile, pos: Int, keywords: List[String]) : Int = {
^
scala/tools/nsc/models/SemanticTokens.scala:516: warning: method is tailrecommended
def buildSym(term: Symbol, pos: Int, isDef: Boolean, tpe: Type): Unit =
^
scala/tools/nsc/symtab/BaseTypeSeqs.scala:145: warning: method is tailrecommended
protected def maxDpth(tp: Type): Int = tp match {
^
scala/tools/nsc/symtab/classfile/Pickler.scala:129: warning: method is tailrecommended
def putSymbol(sym: Symbol) {
^
scala/tools/nsc/symtab/InfoTransformers.scala:21: warning: method is tailrecommended
def insert(that: InfoTransformer) {
^
scala/tools/nsc/symtab/InfoTransformers.scala:39: warning: method is tailrecommended
def nextFrom(from: Phase#Id): InfoTransformer =
^
scala/tools/nsc/symtab/Symbols.scala:1058: warning: method is tailrecommended
def enclClass: Symbol = if (isClass) this else owner.enclClass
^
scala/tools/nsc/symtab/Symbols.scala:1061: warning: method is tailrecommended
def enclMethod: Symbol = if (isSourceMethod) this else owner.enclMethod
^
scala/tools/nsc/symtab/Symbols.scala:1196: warning: method is tailrecommended
def toplevelClass: Symbol =
^
scala/tools/nsc/symtab/Symbols.scala:1419: warning: method is tailrecommended
def sourceFile: AbstractFile =
^
scala/tools/nsc/symtab/Symbols.scala:1426: warning: method is tailrecommended
def isFromClassFile: Boolean =
^
scala/tools/nsc/symtab/Types.scala:307: warning: method is tailrecommended
def narrow: Type =
^
scala/tools/nsc/symtab/Types.scala:678: warning: method is tailrecommended
def isGround: Boolean = this match {
^
scala/tools/nsc/symtab/Types.scala:2288: warning: method is tailrecommended
def typeRef(pre: Type, sym: Symbol, args: List[Type]): Type = {
^
scala/tools/nsc/symtab/Types.scala:2377: warning: method is tailrecommended
def appliedType(tycon: Type, args: List[Type]): Type =
^
scala/tools/nsc/symtab/Types.scala:2584: warning: method is tailrecommended
def allEq[T <: AnyRef](l1: List[T], l2: List[T]): Boolean =
^
scala/tools/nsc/symtab/Types.scala:3013: warning: method is tailrecommended
def subst(tp: Type, sym: Symbol, from: List[Symbol], to: List[T]): Type =
^
scala/tools/nsc/symtab/Types.scala:3793: warning: method is tailrecommended
def beginsWithTypeVarOrIsRefined(tp: Type): Boolean = tp match {
^
scala/tools/nsc/symtab/Types.scala:3804: warning: method is tailrecommended
def instTypeVar(tp: Type): Type = tp match {
^
scala/tools/nsc/symtab/Types.scala:3863: warning: method is tailrecommended
def isSubArgs(tps1: List[Type], tps2: List[Type], tparams: List[Symbol]): Boolean = (
^
scala/tools/nsc/symtab/Types.scala:4245: warning: method is tailrecommended
def matchesType(tp1: Type, tp2: Type, alwaysMatchSimple: Boolean): Boolean = {
^
scala/tools/nsc/transform/CleanUp.scala:84: warning: method is tailrecommended
override def transform(tree: Tree): Tree = tree match {
^
scala/tools/nsc/transform/ExplicitOuter.scala:210: warning: method is tailrecommended
protected def outerPath(base: Tree, from: Symbol, to: Symbol): Tree = {
^
scala/tools/nsc/transform/Reifiers.scala:42: warning: method is tailrecommended
def reify(tp: Type): reflect.Type = tp match {
^
scala/tools/nsc/transform/Reifiers.scala:203: warning: method is tailrecommended
def reify(tree: Tree): reflect.Tree = tree match {
^
scala/tools/nsc/transform/UnCurry.scala:170: warning: method is tailrecommended
def uncurryTreeType(tp: Type): Type = tp match {
^
scala/tools/nsc/typechecker/Contexts.scala:347: warning: method is tailrecommended
def isLocal(): Boolean = tree match {
^
scala/tools/nsc/typechecker/Contexts.scala:354: warning: method is tailrecommended
def nextEnclosing(p: Context => Boolean): Context =
^
scala/tools/nsc/typechecker/Contexts.scala:457: warning: method is tailrecommended
def resetCache : Unit = {
^
scala/tools/nsc/typechecker/DeVirtualize.scala:261: warning: method is tailrecommended
protected def paramTypesAndIndices(tpe: Type, start: Int): List[List[(Type, Int)]] = tpe match {
^
scala/tools/nsc/typechecker/Implicits.scala:71: warning: method is tailrecommended
def isManifest(pt: Type): Boolean = pt.dealias match {
^
scala/tools/nsc/typechecker/Infer.scala:120: warning: method is tailrecommended
private[typechecker] def isFullyDefined(tp: Type): Boolean = tp match {
^
scala/tools/nsc/typechecker/Infer.scala:180: warning: method is tailrecommended
def normalize(tp: Type): Type = skipImplicit(tp) match {
^
scala/tools/nsc/typechecker/Infer.scala:405: warning: method is tailrecommended
def isPlausiblyCompatible(tp: Type, pt: Type): Boolean = tp match {
^
scala/tools/nsc/typechecker/Infer.scala:852: warning: method is tailrecommended
def isAsSpecific(ftpe1: Type, ftpe2: Type): Boolean = ftpe1 match {
^
scala/tools/nsc/typechecker/Infer.scala:894: warning: method is tailrecommended
def isProperSubClassOrObject(sym1: Symbol, sym2: Symbol): Boolean =
^
scala/tools/nsc/typechecker/Infer.scala:1235: warning: method is tailrecommended
def widen(tp: Type): Type = tp match { // @M don't normalize here (compiler loops on pos/bug1090.scala )
^
scala/tools/nsc/typechecker/Typers.scala:323: warning: method is tailrecommended
def checkNonCyclic(pos: Position, tp: Type): Boolean = {
^
scala/tools/nsc/typechecker/Typers.scala:374: warning: method is tailrecommended
def checkParamsConvertible(pos: Position, tpe: Type) {
^
scala/tools/nsc/typechecker/Typers.scala:756: warning: method is tailrecommended
protected def adapt(tree: Tree, mode: Int, pt: Type, original: Tree = EmptyTree): Tree = tree.tpe match {
^
scala/tools/nsc/typechecker/Typers.scala:2049: warning: method is tailrecommended
def doTypedApply(tree: Tree, fun0: Tree, args: List[Tree], mode: Int, pt: Type): Tree = {
^
scala/tools/nsc/typechecker/Typers.scala:2743: warning: method is tailrecommended
protected def typed1(tree: Tree, mode: Int, pt: Type): Tree = {
^
scala/tools/nsc/typechecker/Variances.scala:79: warning: method is tailrecommended
def varianceInType(tp: Type)(tparam: Symbol): Int = tp match {
^
warning: there were deprecation warnings; re-run with -deprecation for details
warning: there were unchecked warnings; re-run with -unchecked for details
77 warnings found