diff options
author | michelou <michelou@epfl.ch> | 2007-12-19 16:52:40 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2007-12-19 16:52:40 +0000 |
commit | 8ad43107f52b278930a663874943de9eda0c8df0 (patch) | |
tree | 2e7fa80109cdd1a2ba1053aad0ff951132f71251 /src | |
parent | 999d30eea73cc19ff1603fc57c13d937c4fc6ce2 (diff) | |
download | scala-8ad43107f52b278930a663874943de9eda0c8df0.tar.gz scala-8ad43107f52b278930a663874943de9eda0c8df0.tar.bz2 scala-8ad43107f52b278930a663874943de9eda0c8df0.zip |
removed deprecated features
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 13 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala | 3 | ||||
-rw-r--r-- | src/library/scala/All$.scala | 25 | ||||
-rw-r--r-- | src/library/scala/AllRef$.scala | 25 | ||||
-rw-r--r-- | src/library/scala/Predef.scala | 6 | ||||
-rw-r--r-- | src/library/scala/Product.scala | 15 | ||||
-rw-r--r-- | src/library/scala/compat/Math.scala | 54 | ||||
-rw-r--r-- | src/library/scala/testing/SUnit.scala | 46 | ||||
-rw-r--r-- | src/library/scala/testing/UnitTest.scala | 95 |
9 files changed, 14 insertions, 268 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index d33c0dc652..e16e1be2d6 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -1,5 +1,5 @@ /* NSC -- new Scala compiler - * Copyright 2005-2007 LAMP/EPFL + * Copyright 2005-2008 LAMP/EPFL * @author Martin Odersky */ // $Id$ @@ -141,7 +141,6 @@ trait Types { override def typeParams = underlying.typeParams override def typeSymbol = underlying.typeSymbol override def typeSymbolDirect = underlying.typeSymbolDirect - @deprecated override def symbol = underlying.symbol override def widen = underlying.widen override def typeOfThis = underlying.typeOfThis override def bounds = underlying.bounds @@ -211,8 +210,6 @@ trait Types { IsDependentTraverser.result } - @deprecated def symbol: Symbol = NoSymbol - /** The term symbol associated with the type * Note that the symbol of the normalized type is returned (@see normalize) */ @@ -868,7 +865,6 @@ trait Types { override def isTrivial: Boolean = sym.isPackageClass override def isNotNull = true override def typeSymbol = sym - @deprecated override def symbol = sym override def underlying: Type = sym.typeOfThis override def prefixString = if (settings.debug.value) sym.nameString + ".this." @@ -930,7 +926,6 @@ trait Types { override def narrow: Type = this override def termSymbol = sym - @deprecated override def symbol = sym override def prefix: Type = pre override def prefixString: String = if ((sym.isEmptyPackage || sym.isInterpreterWrapper || sym.isPredefModule || sym.isScalaPackage) && !settings.debug.value) "" @@ -942,7 +937,6 @@ trait Types { override val isTrivial: Boolean = thistpe.isTrivial && supertpe.isTrivial override def isNotNull = true; override def typeSymbol = thistpe.typeSymbol - @deprecated override def symbol = thistpe.symbol override def underlying = supertpe override def prefix: Type = supertpe.prefix override def prefixString = @@ -1154,7 +1148,6 @@ trait Types { override val decls: Scope, override val typeSymbol: Symbol) extends CompoundType { - @deprecated override def symbol = typeSymbol /** refs indices */ private final val NonExpansive = 0 @@ -1369,7 +1362,6 @@ trait Types { override def termSymbol = if (sym.isAliasType) normalize.termSymbol else super.termSymbol override def typeSymbolDirect = sym override def termSymbolDirect = super.termSymbol - @deprecated override def symbol = if (sym.isAliasType) normalize.symbol else sym /* @MAT whenever you see `tp.typeSymbol.isXXXX' and then act on tp based on that predicate, you're on thin ice, @@ -1618,7 +1610,6 @@ A type's typeSymbol should never be inspected directly. override def decls: Scope = resultType.decls override def termSymbol: Symbol = resultType.termSymbol override def typeSymbol: Symbol = resultType.typeSymbol - @deprecated override def symbol: Symbol = resultType.symbol override def prefix: Type = resultType.prefix override def closure: Array[Type] = resultType.closure override def closureDepth: Int = resultType.closureDepth @@ -1746,7 +1737,6 @@ A type's typeSymbol should never be inspected directly. val level = skolemizationLevel override def typeSymbol = origin.typeSymbol - @deprecated override def symbol = origin.symbol override def toString: String = if (constr.inst eq null) "<null " + origin + ">" else if (constr.inst eq NoType) @@ -1895,7 +1885,6 @@ A type's typeSymbol should never be inspected directly. def refinementOfClass(clazz: Symbol, parents: List[Type], decls: Scope) = { class RefinementOfClass extends RefinedType(parents, decls) { override def typeSymbol: Symbol = clazz - @deprecated override def symbol: Symbol = clazz } new RefinementOfClass } diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala index 26dca38361..94e199a66b 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala @@ -1,5 +1,5 @@ /* NSC -- new Scala compiler - * Copyright 2005-2007 LAMP/EPFL + * Copyright 2005-2008 LAMP/EPFL * @author Martin Odersky */ // $Id$ @@ -255,7 +255,6 @@ abstract class UnPickler { new RefinedType(ps, dcls) { override def symbol = clazz } */ new RefinedType(until(end, readTypeRef), symScope(clazz)(newTempScope)) { - @deprecated override def symbol = clazz override def typeSymbol = clazz } case CLASSINFOtpe => diff --git a/src/library/scala/All$.scala b/src/library/scala/All$.scala deleted file mode 100644 index 879e18a259..0000000000 --- a/src/library/scala/All$.scala +++ /dev/null @@ -1,25 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id: All$.scala 9262 2006-11-14 17:29:59Z mihaylov $ - - -package scala - - -/** - * Dummy class which exist only to satisfy the JVM. It corresponds - * to <code>scala.All</code>. If such type appears in method - * signatures, it is erased to this one. - * - * @deprecated <i>To be removed at some time in the future. Kept only for - * backward compatibility. Newly compiled code will refer to - * <code>scala.runtime.Nothing$</code></i> - */ - -sealed abstract class All$ diff --git a/src/library/scala/AllRef$.scala b/src/library/scala/AllRef$.scala deleted file mode 100644 index dcfd9ad300..0000000000 --- a/src/library/scala/AllRef$.scala +++ /dev/null @@ -1,25 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id: AllRef$.scala 10086 2007-02-21 19:10:41Z odersky $ - - -package scala - - -/** - * Dummy class which exist only to satisfy the JVM. It corresponds - * to <code>scala.AllRef</code>. If such type appears in method - * signatures, it is erased to this one. - * - * @deprecated <i>To be removed at some time in the future. Kept only for - * backward compatibility. Newly compiled code will refer to - * <code>scala.runtime.Null$</code></i> - */ - -sealed abstract class AllRef$ diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala index 6d3ac1aafe..60042b1862 100644 --- a/src/library/scala/Predef.scala +++ b/src/library/scala/Predef.scala @@ -1,6 +1,6 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** +** / __/ __// _ | / / / _ | (c) 2002-2008, LAMP/EPFL ** ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** @@ -35,10 +35,6 @@ object Predef { type boolean = scala.Boolean type unit = scala.Unit - /** @deprecated use <code>Nothing</code> instead */ - @deprecated type All = Nothing - /** @deprecated use <code>Null</code> instead */ - @deprecated type AllRef = Null /** @deprecated use <code>Int</code> instead */ @deprecated type Integer = java.lang.Integer /** @deprecated use <code>Char</code> instead */ diff --git a/src/library/scala/Product.scala b/src/library/scala/Product.scala index 65567a6616..bc77c939ad 100644 --- a/src/library/scala/Product.scala +++ b/src/library/scala/Product.scala @@ -1,6 +1,6 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** +** / __/ __// _ | / / / _ | (c) 2002-2008, LAMP/EPFL ** ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** @@ -28,23 +28,10 @@ trait Product extends AnyRef { */ def productElement(n: Int): Any - /** for a case class <code>A(x_1,...,x_k))</code>, returns <code>x_(i+1)</code> - * for <code>0 <= i < k</code> - * - * @param n the position of the n-th element - * @throws IndexOutOfBoundsException - * @return ... - */ - @deprecated def element(n: Int): Any = productElement(n) - /** return k for a product <code>A(x_1,...,x_k))</code> */ def productArity: Int - /** return k for a product <code>A(x_1,...,x_k))</code> - */ - @deprecated def arity: Int = productArity - /** * By default the empty string. Implementations may override this * method in order to prepend a string prefix to the result of the diff --git a/src/library/scala/compat/Math.scala b/src/library/scala/compat/Math.scala deleted file mode 100644 index 04a103d8df..0000000000 --- a/src/library/scala/compat/Math.scala +++ /dev/null @@ -1,54 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala.compat - -/** - * This class will be removed soon. Use <code>scala.Math</code> instead. - */ -@deprecated -object Math { - val MIN_BYTE = java.lang.Byte.MIN_VALUE - val MAX_BYTE = java.lang.Byte.MAX_VALUE - val MIN_SHORT = java.lang.Short.MIN_VALUE - val MAX_SHORT = java.lang.Short.MAX_VALUE - val MIN_CHAR = java.lang.Character.MIN_VALUE - val MAX_CHAR = java.lang.Character.MAX_VALUE - val MIN_INT = java.lang.Integer.MIN_VALUE - val MAX_INT = java.lang.Integer.MAX_VALUE - val MIN_LONG = java.lang.Long.MIN_VALUE - val MAX_LONG = java.lang.Long.MAX_VALUE - - val MIN_FLOAT = -java.lang.Float.MAX_VALUE - val EPS_FLOAT = java.lang.Float.MIN_VALUE - val MAX_FLOAT = java.lang.Float.MAX_VALUE - val NaN_FLOAT = java.lang.Float.NaN - val NEG_INF_FLOAT = java.lang.Float.NEGATIVE_INFINITY - val POS_INF_FLOAT = java.lang.Float.POSITIVE_INFINITY - - val MIN_DOUBLE = -java.lang.Double.MAX_VALUE - val EPS_DOUBLE = java.lang.Double.MIN_VALUE - val MAX_DOUBLE = java.lang.Double.MAX_VALUE - val NaN_DOUBLE = java.lang.Double.NaN - val NEG_INF_DOUBLE = java.lang.Double.NEGATIVE_INFINITY - val POS_INF_DOUBLE = java.lang.Double.POSITIVE_INFINITY - - val E = java.lang.Math.E - val PI = java.lang.Math.PI - - def min(x: Int, y: Int): Int = java.lang.Math.min(x, y) - def max(x: Int, y: Int): Int = java.lang.Math.max(x, y) - - def ceil (x: Double): Double = java.lang.Math.ceil(x) - def floor(x: Double): Double = java.lang.Math.floor(x) - def log (x: Double): Double = java.lang.Math.log(x) - def sqrt (x: Double): Double = java.lang.Math.sqrt(x) -} diff --git a/src/library/scala/testing/SUnit.scala b/src/library/scala/testing/SUnit.scala index e048cadedf..1a87c64b0e 100644 --- a/src/library/scala/testing/SUnit.scala +++ b/src/library/scala/testing/SUnit.scala @@ -1,6 +1,6 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** / __/ __// _ | / / / _ | (c) 2003-2008, LAMP/EPFL ** ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** @@ -163,6 +163,12 @@ object SUnit { def enableStackTrace: Boolean = true + /** fails if <code>! actual.sameElements(expected)</code> */ + def assertSameElements[A](actual: Seq[A], expected: Seq[A]) { + if (! actual.sameElements(expected)) + fail("(no message)", actual.toString, expected.toString) + } + /** fails if expected != actual */ def assertEquals[A](msg: String, expected: A, actual: A) { if (expected != actual) fail(msg, expected, actual) @@ -192,28 +198,12 @@ object SUnit { def assertNotNull(actual: AnyRef): Unit = assertNotNull("(no message)", actual) - /** - * @deprecated use assertNotEq instead - */ - @deprecated - def assertNotSame(msg: String, expected: AnyRef, actual: AnyRef) { - if (expected eq actual) fail(msg) - } - - /** - * @deprecated use assertNotEq instead - */ - @deprecated - def assertNotSame(expected: AnyRef, actual: AnyRef) { - assertNotEq("(no message)", expected, actual) - } - - /** fail if expected eq actual */ + /** fails if <code>expected eq actual</code> */ def assertNotEq(msg: String, expected: AnyRef, actual: AnyRef) { if (expected eq actual) fail(msg) } - /** fail if expected eq actual */ + /** fails if <code>expected eq actual</code> */ def assertNotEq(expected: AnyRef, actual: AnyRef) { assertNotEq("(no message)", expected, actual) } @@ -228,23 +218,7 @@ object SUnit { assertNull("(no message)", actual) } - /** - * @deprecated use assertEq instead - */ - @deprecated - def assertSame(msg: String, expected: AnyRef, actual: AnyRef) { - if (expected ne actual) fail(msg) - } - - /** - * @deprecated use assertEq instead - */ - @deprecated - def assertSame(expected: AnyRef, actual: AnyRef) { - assertEq("(no message)", expected, actual) - } - - /** fails if expected ne actual */ + /** fails if <code>expected ne actual</code> */ def assertEq(msg: String, expected: AnyRef, actual: AnyRef) { if (expected ne actual) fail(msg) } diff --git a/src/library/scala/testing/UnitTest.scala b/src/library/scala/testing/UnitTest.scala deleted file mode 100644 index 79aa0cbf2e..0000000000 --- a/src/library/scala/testing/UnitTest.scala +++ /dev/null @@ -1,95 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala.testing - -/** - * Some simple methods to support unit testing with assertions - * to contain more JUnit style assertions which use Scala's features. - * - * @author Burak Emir - * - * @deprecated use <a href="SUnit.html" target="contentFrame">SUnit</a> - * instead. - */ -@deprecated -object UnitTest { - - class Report(report_ok: () => Unit, report_fail: (String,String) => Unit) { - def ok(): Unit = report_ok() - def fail(actual: String, expected: String) { - report_fail(actual, expected) - } - } - - var report = new Report( - { () => Console.println("passed ok") }, - { (actual: String, expected: String) => - Console.print("failed! we got ") - Console.print( "\""+ actual +"\"" ) - Console.println(" but expected \"" + expected + "\"") }) - - /** - * @param r ... - */ - def setReporter(r: Report) { - this.report = r - } - - /** - * @param actual ... - * @param expected ... - */ - def assertSameElements[A](actual: Seq[A], expected: Seq[A]) { - if (actual.sameElements(expected)) - report.ok - else - report.fail(actual.toString, expected.toString) - } - - /** - * @param actual ... - * @param expected ... - */ - def assertEquals[A](actual: A, expected: A) { - if (actual == expected) - report.ok - else - report.fail(actual.toString(), expected.toString()) - } - - def assertTrue(actual: Boolean) { assertEquals(actual, true) } - def assertFalse(actual: Boolean) { assertEquals(actual, false) } - - def assertNull(actual: AnyRef) { - if (actual eq null) - report.ok - else - report.fail(actual.toString, "null") - } - - def assertNonNull(actual: AnyRef) { - if (actual ne null) - report.ok - else - report.fail(actual.toString, "null") - } - - def assertNotEquals[A](actual: A, expected: A) { - if (actual != expected) - report.ok - else - report.fail(actual.toString(), "x != "+expected.toString()) - } - - //def test[a](def doit: a, expected: a): Unit = assertEquals(doit, expected) - -} // unitTest |