Skip to content

Commit 1cfb363

Browse files
committed
Merge pull request scala#1648 from paulp/unused-bonanza-2
Removing unused code, take 2.
2 parents 54655b3 + 373ded2 commit 1cfb363

File tree

303 files changed

+338
-4427
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

303 files changed

+338
-4427
lines changed

src/compiler/scala/reflect/reify/Errors.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ trait Errors {
2121
throw new ReificationException(defaultErrorPosition, msg)
2222
}
2323

24-
def CannotReifySymbol(sym: Symbol) = {
25-
val msg = "implementation restriction: cannot reify symbol %s (%s)".format(sym, sym.accurateKindString)
26-
throw new ReificationException(defaultErrorPosition, msg)
27-
}
28-
2924
def CannotReifyWeakType(details: Any) = {
3025
val msg = "cannot create a TypeTag" + details + ": use WeakTypeTag instead"
3126
throw new ReificationException(defaultErrorPosition, msg)

src/compiler/scala/reflect/reify/codegen/GenUtils.scala

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,6 @@ trait GenUtils {
9090
/** An (unreified) path that refers to term definition with given fully qualified name */
9191
def termPath(fullname: String): Tree = path(fullname, newTermName)
9292

93-
/** An (unreified) path that refers to type definition with given fully qualified name */
94-
def typePath(fullname: String): Tree = path(fullname, newTypeName)
95-
96-
def isTough(tpe: Type) = {
97-
def isTough(tpe: Type) = tpe match {
98-
case _: RefinedType => true
99-
case _: ExistentialType => true
100-
case _: ClassInfoType => true
101-
case _: MethodType => true
102-
case _: PolyType => true
103-
case _ => false
104-
}
105-
106-
tpe != null && (tpe exists isTough)
107-
}
108-
10993
object TypedOrAnnotated {
11094
def unapply(tree: Tree): Option[Tree] = tree match {
11195
case ty @ Typed(_, _) =>
@@ -117,15 +101,6 @@ trait GenUtils {
117101
}
118102
}
119103

120-
def isAnnotated(tpe: Type) = {
121-
def isAnnotated(tpe: Type) = tpe match {
122-
case _: AnnotatedType => true
123-
case _ => false
124-
}
125-
126-
tpe != null && (tpe exists isAnnotated)
127-
}
128-
129104
def isSemiConcreteTypeMember(tpe: Type) = tpe match {
130105
case TypeRef(SingleType(_, _), sym, _) if sym.isAbstractType && !sym.isExistential => true
131106
case _ => false

src/compiler/scala/reflect/reify/phases/Metalevels.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package scala.reflect.reify
22
package phases
33

4+
import scala.collection.{ mutable }
5+
46
trait Metalevels {
57
self: Reifier =>
68

@@ -101,7 +103,7 @@ trait Metalevels {
101103
*/
102104
val metalevels = new Transformer {
103105
var insideSplice = false
104-
var inlineableBindings = scala.collection.mutable.Map[TermName, Tree]()
106+
val inlineableBindings = mutable.Map[TermName, Tree]()
105107

106108
def withinSplice[T](op: => T) = {
107109
val old = insideSplice

src/compiler/scala/reflect/reify/utils/SymbolTables.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ trait SymbolTables {
1515
private[SymbolTable] val original: Option[List[Tree]] = None) {
1616

1717
def syms: List[Symbol] = symtab.keys.toList
18-
def isConcrete: Boolean = symtab.values forall (sym => !FreeTypeDef.unapply(sym).isDefined)
19-
20-
// def aliases: Map[Symbol, List[TermName]] = aliases.distinct groupBy (_._1) mapValues (_ map (_._2))
2118

2219
def symDef(sym: Symbol): Tree =
2320
symtab.getOrElse(sym, EmptyTree)

src/compiler/scala/tools/ant/sabbus/Settings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ package scala.tools.ant.sabbus
1010

1111
import java.io.File
1212

13-
import org.apache.tools.ant.types.{Path, Reference}
13+
import org.apache.tools.ant.types.Path
1414

1515
class Settings {
1616

src/compiler/scala/tools/cmd/FromString.scala

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,11 @@ abstract class FromString[+T](implicit t: ru.TypeTag[T]) extends PartialFunction
2424
}
2525

2626
object FromString {
27-
// We need these because we clash with the String => Path implicits.
28-
private def toFile(s: String) = new File(new java.io.File(s))
27+
// We need this because we clash with the String => Path implicits.
2928
private def toDir(s: String) = new Directory(new java.io.File(s))
3029

3130
/** Path related stringifiers.
3231
*/
33-
val ExistingFile: FromString[File] = new FromString[File]()(tagOfFile) {
34-
override def isDefinedAt(s: String) = toFile(s).isFile
35-
def apply(s: String): File =
36-
if (isDefinedAt(s)) toFile(s)
37-
else cmd.runAndExit(println("'%s' is not an existing file." format s))
38-
}
3932
val ExistingDir: FromString[Directory] = new FromString[Directory]()(tagOfDirectory) {
4033
override def isDefinedAt(s: String) = toDir(s).isDirectory
4134
def apply(s: String): Directory =

src/compiler/scala/tools/cmd/Reference.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ trait Reference extends Spec {
2626
def isUnaryOption(s: String) = unary contains toOpt(s)
2727
def isBinaryOption(s: String) = binary contains toOpt(s)
2828
def isExpandOption(s: String) = expansionMap contains toOpt(s)
29-
def isAnyOption(s: String) = isUnaryOption(s) || isBinaryOption(s) || isExpandOption(s)
3029

3130
def expandArg(arg: String) = expansionMap.getOrElse(fromOpt(arg), List(arg))
3231

src/compiler/scala/tools/nsc/CompilationUnits.scala

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ trait CompilationUnits { self: Global =>
2626
class CompilationUnit(val source: SourceFile) extends CompilationUnitContextApi {
2727

2828
/** the fresh name creator */
29-
var fresh: FreshNameCreator = new FreshNameCreator.Default
29+
val fresh: FreshNameCreator = new FreshNameCreator.Default
3030

3131
def freshTermName(prefix: String): TermName = newTermName(fresh.newName(prefix))
3232
def freshTypeName(prefix: String): TypeName = newTypeName(fresh.newName(prefix))
@@ -36,16 +36,6 @@ trait CompilationUnits { self: Global =>
3636

3737
def exists = source != NoSourceFile && source != null
3838

39-
// def parseSettings() = {
40-
// val argsmarker = "SCALAC_ARGS"
41-
// if(comments nonEmpty) {
42-
// val pragmas = comments find (_.text.startsWith("//#")) // only parse first one
43-
// pragmas foreach { p =>
44-
// val i = p.text.indexOf(argsmarker)
45-
// if(i > 0)
46-
// }
47-
// }
48-
// }
4939
/** Note: depends now contains toplevel classes.
5040
* To get their sourcefiles, you need to dereference with .sourcefile
5141
*/
@@ -107,18 +97,5 @@ trait CompilationUnits { self: Global =>
10797
lazy val isJava = source.file.name.endsWith(".java")
10898

10999
override def toString() = source.toString()
110-
111-
def clear() {
112-
fresh = new FreshNameCreator.Default
113-
body = EmptyTree
114-
depends.clear()
115-
defined.clear()
116-
synthetics.clear()
117-
toCheck.clear()
118-
checkedFeatures = Set()
119-
icode.clear()
120-
}
121100
}
122101
}
123-
124-

src/compiler/scala/tools/nsc/CompileServer.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class StandardCompileServer extends SocketServer {
2929
var shutdown = false
3030
var verbose = false
3131

32-
val versionMsg = "Fast " + Properties.versionMsg
33-
3432
val MaxCharge = 0.8
3533

3634
private val runtime = Runtime.getRuntime()

src/compiler/scala/tools/nsc/CompilerCommand.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ class CompilerCommand(arguments: List[String], val settings: Settings) {
1414

1515
type Setting = Settings#Setting
1616

17-
/** file extensions of files that the compiler can process */
18-
lazy val fileEndings = Properties.fileEndings
19-
2017
private val processArgumentsResult =
2118
if (shouldProcessArguments) processArguments
2219
else (true, Nil)
@@ -40,8 +37,6 @@ class CompilerCommand(arguments: List[String], val settings: Settings) {
4037
""".stripMargin.trim + "\n"
4138

4239
def shortUsage = "Usage: %s <options> <source files>" format cmdName
43-
def createUsagePreface(shouldExplain: Boolean) =
44-
if (shouldExplain) shortUsage + "\n" + explainAdvanced else ""
4540

4641
/** Creates a help message for a subset of options based on cond */
4742
def createUsageMsg(cond: Setting => Boolean): String = {

src/compiler/scala/tools/nsc/CompilerRun.scala

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)