diff options
author | Paul Phillips <paulp@improving.org> | 2010-05-24 00:04:05 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-05-24 00:04:05 +0000 |
commit | 67a650205b9f18f58063883dc6150009f8bdaae3 (patch) | |
tree | ba8c28e5bfe10aabf1f2fb4e3ebc731097edf8ff /src | |
parent | a33ef273d057c043d4129927f27230f54051ac88 (diff) | |
download | scala-67a650205b9f18f58063883dc6150009f8bdaae3.tar.gz scala-67a650205b9f18f58063883dc6150009f8bdaae3.tar.bz2 scala-67a650205b9f18f58063883dc6150009f8bdaae3.zip |
Removed a few instances of redundant or dead co...
Removed a few instances of redundant or dead code, most of which was
marked as waiting for a new starr which has long since arrived. No
review.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Definitions.scala | 9 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/StdNames.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala | 6 | ||||
-rw-r--r-- | src/library/scala/LowPriorityImplicits.scala | 1 | ||||
-rw-r--r-- | src/library/scala/Product.scala | 15 | ||||
-rw-r--r-- | src/library/scala/runtime/NonLocalReturnException.scala | 18 | ||||
-rw-r--r-- | src/scalap/scala/tools/scalap/Main.scala | 15 |
7 files changed, 7 insertions, 59 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index 7857fa35d5..597a34c773 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -7,8 +7,9 @@ package scala.tools.nsc package symtab import scala.collection.mutable.{HashMap, HashSet} -import scala.tools.nsc.util.{Position, NoPosition} +import scala.tools.nsc.util.NoPosition import Flags._ +import PartialFunction._ trait Definitions extends reflect.generic.StandardDefinitions { self: SymbolTable => @@ -16,12 +17,6 @@ trait Definitions extends reflect.generic.StandardDefinitions { object definitions extends AbsDefinitions { def isDefinitionsInitialized = isInitialized - // Working around bug #2133 - private object definitionHelpers { - def cond[T](x: T)(f: PartialFunction[T, Boolean]) = (f isDefinedAt x) && f(x) - } - import definitionHelpers._ - // symbols related to packages var emptypackagescope: Scope = null //debug diff --git a/src/compiler/scala/tools/nsc/symtab/StdNames.scala b/src/compiler/scala/tools/nsc/symtab/StdNames.scala index 2a88330fa8..ed72fc16fa 100644 --- a/src/compiler/scala/tools/nsc/symtab/StdNames.scala +++ b/src/compiler/scala/tools/nsc/symtab/StdNames.scala @@ -329,7 +329,7 @@ trait StdNames extends reflect.generic.StdNames { self: SymbolTable => val print = newTermName("print") val productArity = newTermName("productArity") val productElement = newTermName("productElement") - val productElementName = newTermName("productElementName") + // val productElementName = newTermName("productElementName") val productPrefix = newTermName("productPrefix") val readResolve = newTermName("readResolve") val sameElements = newTermName("sameElements") diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala index 6ef9122b1d..f33e3506fd 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala @@ -87,7 +87,7 @@ trait SyntheticMethods extends ast.TreeDSL { typer typed { DEF(method) === LIT(nargs) } } - /** Common code for productElement and productElementName + /** Common code for productElement and (currently disabled) productElementName */ def perElementMethod(accs: List[Symbol], methodName: Name, resType: Type, caseFn: Symbol => Tree): Tree = { val symToTpe = makeTypeConstructor(List(IntClass.tpe), resType) @@ -107,8 +107,8 @@ trait SyntheticMethods extends ast.TreeDSL { def productElementMethod(accs: List[Symbol]): Tree = perElementMethod(accs, nme.productElement, AnyClass.tpe, x => Ident(x)) - def productElementNameMethod(accs: List[Symbol]): Tree = - perElementMethod(accs, nme.productElementName, StringClass.tpe, x => Literal(x.name.toString)) + // def productElementNameMethod(accs: List[Symbol]): Tree = + // perElementMethod(accs, nme.productElementName, StringClass.tpe, x => Literal(x.name.toString)) def moduleToStringMethod: Tree = { val method = syntheticMethod(nme.toString_, FINAL, makeNoArgConstructor(StringClass.tpe)) diff --git a/src/library/scala/LowPriorityImplicits.scala b/src/library/scala/LowPriorityImplicits.scala index 1241f642a5..6fdf977dd4 100644 --- a/src/library/scala/LowPriorityImplicits.scala +++ b/src/library/scala/LowPriorityImplicits.scala @@ -48,6 +48,7 @@ class LowPriorityImplicits { } /** Can go away after next newstarr */ + /** Caution - not yet. pos/t1459, pos/t2569, jvm/t1342 all fail without the next line. */ def wrapArray[T <: AnyRef](xs: Array[T]): WrappedArray[T] = new WrappedArray.ofRef[T](xs) def wrapArray(xs: Array[Int]): WrappedArray[Int] = new WrappedArray.ofInt(xs) def wrapArray(xs: Array[Double]): WrappedArray[Double] = new WrappedArray.ofDouble(xs) diff --git a/src/library/scala/Product.scala b/src/library/scala/Product.scala index 18c557e40a..b7dd6cf728 100644 --- a/src/library/scala/Product.scala +++ b/src/library/scala/Product.scala @@ -28,21 +28,6 @@ trait Product extends Equals { */ def productElement(n: Int): Any - // !!! This will be disabled pending reimplementation, but it can't be removed - // until starr forgets about it. - - /** Returns the name of the field at the given index from the definition - * of the class. - * - * @param n the index of the element name to return - * @throws NoSuchElementException if the name data is unavailable for any reason - * @throws IndexOutOfBoundsException if the index is out of range - * @return a String representing the field name - */ - def productElementName(n: Int): String = - // the method implementation is synthetic - if it is not generated we always throw. - throw new NoSuchElementException() - /** return k for a product <code>A(x_1,...,x_k)</code> */ def productArity: Int diff --git a/src/library/scala/runtime/NonLocalReturnException.scala b/src/library/scala/runtime/NonLocalReturnException.scala deleted file mode 100644 index e2e39071c2..0000000000 --- a/src/library/scala/runtime/NonLocalReturnException.scala +++ /dev/null @@ -1,18 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2010, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - - - -package scala.runtime - -import scala.util.control.ControlThrowable - -/** !!! This class has been replaced by NonLocalReturnControl and should be deleted. - * But, it can't be deleted until starr is updated to use the new name. - */ -class NonLocalReturnException[T](val key: AnyRef, val value: T) extends ControlThrowable diff --git a/src/scalap/scala/tools/scalap/Main.scala b/src/scalap/scala/tools/scalap/Main.scala index 54a3db54c9..88b6c53c46 100644 --- a/src/scalap/scala/tools/scalap/Main.scala +++ b/src/scalap/scala/tools/scalap/Main.scala @@ -126,9 +126,6 @@ object Main { } } - - - /**Executes scalap with the given arguments and classpath for the * class denoted by <code>classname</code>. * @@ -157,18 +154,6 @@ object Main { val clazz = new Classfile(reader) processJavaClassFile(clazz) } - // if the class corresponds to the artificial class scala.All. - // (to be removed after update of the STARR libraries) - } else if (classname == "scala.All") { - Console.println("package scala") - Console.println("/* Deprecated. Use scala.Nothing instead. */") - Console.println("sealed abstract class All") - // if the class corresponds to the artificial class scala.AllRef. - // (to be removed after update of the STARR libraries) - } else if (classname == "scala.AllRef") { - Console.println("package scala") - Console.println("/* Deprecated. Use scala.Null instead. */") - Console.println("sealed abstract class AllRef") // if the class corresponds to the artificial class scala.Any. // (see member list in class scala.tool.nsc.symtab.Definitions) } else if (classname == "scala.Any") { |