diff options
Diffstat (limited to 'src/library')
36 files changed, 48 insertions, 55 deletions
diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala index 700b5bfbac..8881cd1fbe 100644 --- a/src/library/scala/Predef.scala +++ b/src/library/scala/Predef.scala @@ -56,7 +56,7 @@ object Predef extends LowPriorityImplicits { def implicitly[T](implicit e: T) = e // for summoning implicit values from the nether world @inline def locally[T](x: T): T = x // to communicate intent and avoid unmoored statements - // errors and asserts ------------------------------------------------- + // Deprecated @deprecated("Use system.error(message) instead") def error(message: String): Nothing = system.error(message) @@ -67,6 +67,11 @@ object Predef extends LowPriorityImplicits { @deprecated("Use system.exit(status) instead") def exit(status: Int): Nothing = system.exit(status) + @deprecated("Use formatString.format(args: _*) or arg.formatted(formatString) instead") + def format(text: String, xs: Any*) = augmentString(text).format(xs: _*) + + // errors and asserts ------------------------------------------------- + /** Tests an expression, throwing an AssertionError if false. * Calls to this method will not be generated if -Xelide-below * is at least ASSERTION. @@ -183,9 +188,6 @@ object Predef extends LowPriorityImplicits { def println(x: Any) = Console.println(x) def printf(text: String, xs: Any*) = Console.print(text.format(xs: _*)) - @deprecated("Use formatString.format(args: _*) or arg.formatted(formatString) instead") - def format(text: String, xs: Any*) = augmentString(text).format(xs: _*) - def readLine(): String = Console.readLine() def readLine(text: String, args: Any*) = Console.readLine(text, args) def readBoolean() = Console.readBoolean() diff --git a/src/library/scala/SerialVersionUID.scala b/src/library/scala/SerialVersionUID.scala index 0a2e29c934..ae1d377646 100644 --- a/src/library/scala/SerialVersionUID.scala +++ b/src/library/scala/SerialVersionUID.scala @@ -15,4 +15,4 @@ package scala * Annotation for specifying the <code>static SerialVersionUID</code> field * of a serializable class. */ -class SerialVersionUID(uid: Long) extends StaticAnnotation +class SerialVersionUID(uid: Long) extends annotation.StaticAnnotation diff --git a/src/library/scala/Annotation.scala b/src/library/scala/annotation/Annotation.scala index 8c75e15a79..06e3fb3b4f 100644 --- a/src/library/scala/Annotation.scala +++ b/src/library/scala/annotation/Annotation.scala @@ -6,9 +6,7 @@ ** |/ ** \* */ - - -package scala +package scala.annotation /** <p> * A base class for annotations. Annotations extending this class directly diff --git a/src/library/scala/ClassfileAnnotation.scala b/src/library/scala/annotation/ClassfileAnnotation.scala index b762d71a97..aca9d2d13f 100644 --- a/src/library/scala/ClassfileAnnotation.scala +++ b/src/library/scala/annotation/ClassfileAnnotation.scala @@ -6,9 +6,7 @@ ** |/ ** \* */ - - -package scala +package scala.annotation /** <p> * A base class for classfile annotations. These are stored as diff --git a/src/library/scala/StaticAnnotation.scala b/src/library/scala/annotation/StaticAnnotation.scala index a1c3828173..1bbeaf6a5d 100644 --- a/src/library/scala/StaticAnnotation.scala +++ b/src/library/scala/annotation/StaticAnnotation.scala @@ -6,9 +6,7 @@ ** |/ ** \* */ - - -package scala +package scala.annotation /** <p> * A base class for static annotations. These are available @@ -19,4 +17,4 @@ package scala * @version 1.1, 2/02/2007 * @since 2.4 */ -trait StaticAnnotation extends Annotation {} +trait StaticAnnotation extends Annotation diff --git a/src/library/scala/TypeConstraint.scala b/src/library/scala/annotation/TypeConstraint.scala index 1cb7e55823..2cd8be210f 100644 --- a/src/library/scala/TypeConstraint.scala +++ b/src/library/scala/annotation/TypeConstraint.scala @@ -6,9 +6,7 @@ ** |/ ** \* */ - - -package scala +package scala.annotation /** <p> * A marker for annotations that, when applied to a type, diff --git a/src/library/scala/annotation/elidable.scala b/src/library/scala/annotation/elidable.scala index c75299e9fd..1767e044fe 100644 --- a/src/library/scala/annotation/elidable.scala +++ b/src/library/scala/annotation/elidable.scala @@ -27,7 +27,7 @@ import java.util.logging.Level * }}} * @since 2.8 */ -final class elidable(final val level: Int) extends StaticAnnotation {} +final class elidable(final val level: Int) extends annotation.StaticAnnotation {} /** This useless appearing code was necessary to allow people to use * named constants for the elidable annotation. This is what it takes diff --git a/src/library/scala/annotation/implicitNotFound.scala b/src/library/scala/annotation/implicitNotFound.scala index 5d9b29c5f8..ffc9bce83a 100644 --- a/src/library/scala/annotation/implicitNotFound.scala +++ b/src/library/scala/annotation/implicitNotFound.scala @@ -15,4 +15,4 @@ package scala.annotation * @author Adriaan Moors * @since 2.8.1 */ -final class implicitNotFound(msg: String) extends StaticAnnotation {}
\ No newline at end of file +final class implicitNotFound(msg: String) extends annotation.StaticAnnotation {}
\ No newline at end of file diff --git a/src/library/scala/annotation/migration.scala b/src/library/scala/annotation/migration.scala index b0915cde34..8a5222f481 100644 --- a/src/library/scala/annotation/migration.scala +++ b/src/library/scala/annotation/migration.scala @@ -25,4 +25,4 @@ private[scala] final class migration( majorVersion: Int, minorVersion: Int, message: String) -extends StaticAnnotation {} +extends annotation.StaticAnnotation {} diff --git a/src/library/scala/annotation/serializable.scala b/src/library/scala/annotation/serializable.scala index 1364d7dcce..49d4c50e6d 100644 --- a/src/library/scala/annotation/serializable.scala +++ b/src/library/scala/annotation/serializable.scala @@ -12,4 +12,4 @@ package scala.annotation * An annotation that designates the class to which it is applied as serializable */ @deprecated("instead of `@serializable class C`, use `class C extends Serializable`") -class serializable extends StaticAnnotation +class serializable extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/strictfp.scala b/src/library/scala/annotation/strictfp.scala index b6852c69ef..4fa19f0de0 100644 --- a/src/library/scala/annotation/strictfp.scala +++ b/src/library/scala/annotation/strictfp.scala @@ -15,4 +15,4 @@ package scala.annotation * @version 2.9 * @since 2.9 */ -class strictfp extends StaticAnnotation +class strictfp extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/switch.scala b/src/library/scala/annotation/switch.scala index a34436f503..4e6e1f5571 100644 --- a/src/library/scala/annotation/switch.scala +++ b/src/library/scala/annotation/switch.scala @@ -35,4 +35,4 @@ package scala.annotation * * @since 2.8 */ -final class switch extends StaticAnnotation +final class switch extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/tailrec.scala b/src/library/scala/annotation/tailrec.scala index 5e59c9fbf8..32f6f587e1 100644 --- a/src/library/scala/annotation/tailrec.scala +++ b/src/library/scala/annotation/tailrec.scala @@ -15,4 +15,4 @@ package scala.annotation * * @since 2.8 */ -final class tailrec extends StaticAnnotation +final class tailrec extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/target/beanGetter.scala b/src/library/scala/annotation/target/beanGetter.scala index e815e697ad..699f8ced4e 100644 --- a/src/library/scala/annotation/target/beanGetter.scala +++ b/src/library/scala/annotation/target/beanGetter.scala @@ -48,4 +48,4 @@ package scala.annotation.target * class myAnnotation extends Annotation * }}} */ -final class beanGetter extends StaticAnnotation +final class beanGetter extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/target/beanSetter.scala b/src/library/scala/annotation/target/beanSetter.scala index d7199694e5..6f4887aa0c 100644 --- a/src/library/scala/annotation/target/beanSetter.scala +++ b/src/library/scala/annotation/target/beanSetter.scala @@ -48,4 +48,4 @@ package scala.annotation.target * class myAnnotation extends Annotation * }}} */ -final class beanSetter extends StaticAnnotation +final class beanSetter extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/target/field.scala b/src/library/scala/annotation/target/field.scala index 94e82bcbe2..71b09c27e6 100644 --- a/src/library/scala/annotation/target/field.scala +++ b/src/library/scala/annotation/target/field.scala @@ -48,4 +48,4 @@ package scala.annotation.target * class myAnnotation extends Annotation * }}} */ -final class field extends StaticAnnotation +final class field extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/target/getter.scala b/src/library/scala/annotation/target/getter.scala index 2d5e856173..10266a0430 100644 --- a/src/library/scala/annotation/target/getter.scala +++ b/src/library/scala/annotation/target/getter.scala @@ -48,4 +48,4 @@ package scala.annotation.target * class myAnnotation extends Annotation * }}} */ -final class getter extends StaticAnnotation +final class getter extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/target/param.scala b/src/library/scala/annotation/target/param.scala index 317080f2cb..e310178c83 100644 --- a/src/library/scala/annotation/target/param.scala +++ b/src/library/scala/annotation/target/param.scala @@ -48,4 +48,4 @@ package scala.annotation.target * class myAnnotation extends Annotation * }}} */ -final class param extends StaticAnnotation +final class param extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/target/setter.scala b/src/library/scala/annotation/target/setter.scala index 4e0758b6eb..e7884de263 100644 --- a/src/library/scala/annotation/target/setter.scala +++ b/src/library/scala/annotation/target/setter.scala @@ -48,4 +48,4 @@ package scala.annotation.target * class myAnnotation extends Annotation * }}} */ -final class setter extends StaticAnnotation +final class setter extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/unchecked/uncheckedStable.scala b/src/library/scala/annotation/unchecked/uncheckedStable.scala index a778f45147..7a69c247f9 100644 --- a/src/library/scala/annotation/unchecked/uncheckedStable.scala +++ b/src/library/scala/annotation/unchecked/uncheckedStable.scala @@ -12,4 +12,4 @@ package scala.annotation.unchecked * * @since 2.7 */ -final class uncheckedStable extends StaticAnnotation {} +final class uncheckedStable extends annotation.StaticAnnotation {} diff --git a/src/library/scala/annotation/unchecked/uncheckedVariance.scala b/src/library/scala/annotation/unchecked/uncheckedVariance.scala index 52f4fb5cc0..81432e05ad 100644 --- a/src/library/scala/annotation/unchecked/uncheckedVariance.scala +++ b/src/library/scala/annotation/unchecked/uncheckedVariance.scala @@ -12,4 +12,4 @@ package scala.annotation.unchecked * * @since 2.7 */ -final class uncheckedVariance extends StaticAnnotation {} +final class uncheckedVariance extends annotation.StaticAnnotation {} diff --git a/src/library/scala/annotation/varargs.scala b/src/library/scala/annotation/varargs.scala index ad6a3f9bd4..e4b4c09840 100644 --- a/src/library/scala/annotation/varargs.scala +++ b/src/library/scala/annotation/varargs.scala @@ -15,4 +15,4 @@ package scala.annotation * * @since 2.9 */ -final class varargs extends StaticAnnotation +final class varargs extends annotation.StaticAnnotation diff --git a/src/library/scala/cloneable.scala b/src/library/scala/cloneable.scala index 9becd3f231..e2c4978380 100644 --- a/src/library/scala/cloneable.scala +++ b/src/library/scala/cloneable.scala @@ -13,4 +13,4 @@ package scala /** * An annotation that designates the class to which it is applied as cloneable */ -class cloneable extends StaticAnnotation +class cloneable extends annotation.StaticAnnotation diff --git a/src/library/scala/deprecated.scala b/src/library/scala/deprecated.scala index 50a6601d00..9a9be1eac3 100644 --- a/src/library/scala/deprecated.scala +++ b/src/library/scala/deprecated.scala @@ -19,6 +19,6 @@ import annotation.target._ * @since 2.3 */ @getter @setter @beanGetter @beanSetter -class deprecated(message: String) extends StaticAnnotation { +class deprecated(message: String) extends annotation.StaticAnnotation { def this() = this("") } diff --git a/src/library/scala/deprecatedName.scala b/src/library/scala/deprecatedName.scala index 30d0ae457a..e91ce6e8f4 100644 --- a/src/library/scala/deprecatedName.scala +++ b/src/library/scala/deprecatedName.scala @@ -10,4 +10,4 @@ import annotation.target._ * @since 2.8.1 */ @param -class deprecatedName(name: Symbol) extends StaticAnnotation +class deprecatedName(name: Symbol) extends annotation.StaticAnnotation diff --git a/src/library/scala/inline.scala b/src/library/scala/inline.scala index 1e91be2b17..06b7ef10b5 100644 --- a/src/library/scala/inline.scala +++ b/src/library/scala/inline.scala @@ -17,4 +17,4 @@ package scala * @author Lex Spoon * @version 1.0, 2007-5-21 */ -class inline extends StaticAnnotation +class inline extends annotation.StaticAnnotation diff --git a/src/library/scala/native.scala b/src/library/scala/native.scala index 8f5f3e8319..71f5bbd74e 100644 --- a/src/library/scala/native.scala +++ b/src/library/scala/native.scala @@ -20,4 +20,4 @@ package scala * but it is type checked when present. * * @since 2.6 */ -class native extends StaticAnnotation {} +class native extends annotation.StaticAnnotation {} diff --git a/src/library/scala/noinline.scala b/src/library/scala/noinline.scala index 18270e7bc5..2a21ae30ba 100644 --- a/src/library/scala/noinline.scala +++ b/src/library/scala/noinline.scala @@ -18,4 +18,4 @@ package scala * @version 1.0, 2007-5-21 * @since 2.5 */ -class noinline extends StaticAnnotation +class noinline extends annotation.StaticAnnotation diff --git a/src/library/scala/package.scala b/src/library/scala/package.scala index 2a30ce5061..74a2a7030e 100644 --- a/src/library/scala/package.scala +++ b/src/library/scala/package.scala @@ -166,9 +166,9 @@ package object scala { @deprecated("Use ((x1, x2, ...)) syntax to create Tuples") def Tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22](x1: A1, x2: A2, x3: A3, x4: A4, x5: A5, x6: A6, x7: A7, x8: A8, x9: A9, x10: A10, x11: A11, x12: A12, x13: A13, x14: A14, x15: A15, x16: A16, x17: A17, x18: A18, x19: A19, x20: A20, x21: A21, x22: A22) = Tuple22(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) - @deprecated("use <code>java.lang.Integer</code> instead") + @deprecated("use java.lang.Integer instead") type Integer = java.lang.Integer - @deprecated("use <code>java.lang.Character</code> instead") + @deprecated("use java.lang.Character instead") type Character = java.lang.Character @deprecated("use Iterable instead") type Collection[+A] = Iterable[A] @@ -179,10 +179,9 @@ package object scala { @deprecated("use IndexedSeq instead") type RandomAccessSeq[+A] = scala.collection.IndexedSeq[A] @deprecated("use IndexedSeq instead") val RandomAccessSeq = scala.collection.IndexedSeq -/* the following classes should be moved to annotation and the aliases should be enabled - @deprecated("use annotation.Annotation instead") type Annotation = annotation.Annotation - @deprecated("use annotation.ClassfileAnnotation instead") type ClassfileAnnotation = annotation.Annotation - @deprecated("use annotation.StaticAnnotation instead") type StaticAnnotation = annotation.Annotation - @deprecated("use annotation.TypeConstraint instead") type TypeConstraint = annotation.TypeConstraint -*/ + + @deprecated("use scala.annotation.Annotation instead") type Annotation = scala.annotation.Annotation + @deprecated("use scala.annotation.ClassfileAnnotation instead") type ClassfileAnnotation = scala.annotation.ClassfileAnnotation + @deprecated("use scala.annotation.StaticAnnotation instead") type StaticAnnotation = scala.annotation.StaticAnnotation + @deprecated("use scala.annotation.TypeConstraint instead") type TypeConstraint = scala.annotation.TypeConstraint } diff --git a/src/library/scala/reflect/BeanProperty.scala b/src/library/scala/reflect/BeanProperty.scala index d784774882..5ae19602ea 100644 --- a/src/library/scala/reflect/BeanProperty.scala +++ b/src/library/scala/reflect/BeanProperty.scala @@ -31,4 +31,4 @@ import annotation.target._ * </p> */ @field -class BeanProperty extends StaticAnnotation +class BeanProperty extends annotation.StaticAnnotation diff --git a/src/library/scala/reflect/BooleanBeanProperty.scala b/src/library/scala/reflect/BooleanBeanProperty.scala index f90f11f7cb..d606f24991 100644 --- a/src/library/scala/reflect/BooleanBeanProperty.scala +++ b/src/library/scala/reflect/BooleanBeanProperty.scala @@ -20,4 +20,4 @@ import annotation.target._ * </p> */ @field -class BooleanBeanProperty extends StaticAnnotation +class BooleanBeanProperty extends annotation.StaticAnnotation diff --git a/src/library/scala/remote.scala b/src/library/scala/remote.scala index bcbc597338..38d9c5b7b3 100644 --- a/src/library/scala/remote.scala +++ b/src/library/scala/remote.scala @@ -13,4 +13,4 @@ package scala /** * An annotation that designates the class to which it is applied as remotable. */ -class remote extends StaticAnnotation {} +class remote extends annotation.StaticAnnotation {} diff --git a/src/library/scala/specialized.scala b/src/library/scala/specialized.scala index f4ce207c4b..aba65bb044 100644 --- a/src/library/scala/specialized.scala +++ b/src/library/scala/specialized.scala @@ -25,7 +25,7 @@ package scala * * @since 2.8 */ -class specialized(types: runtime.AnyValCompanion*) extends StaticAnnotation { +class specialized(types: runtime.AnyValCompanion*) extends annotation.StaticAnnotation { def this() { this(Unit, Boolean, Byte, Short, Char, Int, Long, Float, Double) } diff --git a/src/library/scala/throws.scala b/src/library/scala/throws.scala index 62dfc8fc96..670384cc6f 100644 --- a/src/library/scala/throws.scala +++ b/src/library/scala/throws.scala @@ -25,4 +25,4 @@ package scala * @version 1.0, 19/05/2006 * @since 2.1 */ -class throws(clazz: Class[_]) extends StaticAnnotation +class throws(clazz: Class[_]) extends annotation.StaticAnnotation diff --git a/src/library/scala/transient.scala b/src/library/scala/transient.scala index 12aa15fd1f..4358c196c6 100644 --- a/src/library/scala/transient.scala +++ b/src/library/scala/transient.scala @@ -13,4 +13,4 @@ package scala import annotation.target._ @field -class transient extends StaticAnnotation +class transient extends annotation.StaticAnnotation diff --git a/src/library/scala/volatile.scala b/src/library/scala/volatile.scala index 7c9d9726bd..ad408a0235 100644 --- a/src/library/scala/volatile.scala +++ b/src/library/scala/volatile.scala @@ -13,4 +13,4 @@ package scala import annotation.target._ @field -class volatile extends StaticAnnotation +class volatile extends annotation.StaticAnnotation |