diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-06 04:04:56 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-06 04:04:56 +0000 |
commit | 8922c4ed092a2fb4c3f6002f7c49d304f299cd02 (patch) | |
tree | 7ca9c695328777ad292deac95b4c0347b6c38280 /src/library/scala/annotation | |
parent | b6db478a9641dd488f00fab0c0a113ef83fec5d3 (diff) | |
download | scala-8922c4ed092a2fb4c3f6002f7c49d304f299cd02.tar.gz scala-8922c4ed092a2fb4c3f6002f7c49d304f299cd02.tar.bz2 scala-8922c4ed092a2fb4c3f6002f7c49d304f299cd02.zip |
Moved ClassfileAnnotation/StaticAnnotation/Anno...
Moved ClassfileAnnotation/StaticAnnotation/Annotation/TypeConstraint
into scala.annotation and enabled the deprecated type aliases in scala.*
to point there. Also enclosed is a new starr to bootstrap. No review.
Diffstat (limited to 'src/library/scala/annotation')
20 files changed, 109 insertions, 16 deletions
diff --git a/src/library/scala/annotation/Annotation.scala b/src/library/scala/annotation/Annotation.scala new file mode 100644 index 0000000000..06e3fb3b4f --- /dev/null +++ b/src/library/scala/annotation/Annotation.scala @@ -0,0 +1,24 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2006-2010, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +package scala.annotation + +/** <p> + * A base class for annotations. Annotations extending this class directly + * are not preserved for the Scala type checker and are also not stored + * as Java annotations in classfiles. To enable either or both of these, + * one needs to inherit from + * <a href="StaticAnnotation.html"><code>StaticAnnotation</code></a> or/and + * <a href="ClassfileAnnotation.html"><code>ClassfileAnnotation</code></a>. + * </p> + * + * @author Martin Odersky + * @version 1.1, 2/02/2007 + * @since 2.4 + */ +abstract class Annotation {} diff --git a/src/library/scala/annotation/ClassfileAnnotation.scala b/src/library/scala/annotation/ClassfileAnnotation.scala new file mode 100644 index 0000000000..aca9d2d13f --- /dev/null +++ b/src/library/scala/annotation/ClassfileAnnotation.scala @@ -0,0 +1,21 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2006-2010, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +package scala.annotation + +/** <p> + * A base class for classfile annotations. These are stored as + * <a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html" + * target="_top">Java annotations</a> in classfiles. + * </p> + * + * @author Martin Odersky + * @version 1.1, 2/02/2007 + * @since 2.4 + */ +trait ClassfileAnnotation extends StaticAnnotation diff --git a/src/library/scala/annotation/StaticAnnotation.scala b/src/library/scala/annotation/StaticAnnotation.scala new file mode 100644 index 0000000000..1bbeaf6a5d --- /dev/null +++ b/src/library/scala/annotation/StaticAnnotation.scala @@ -0,0 +1,20 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2006-2010, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +package scala.annotation + +/** <p> + * A base class for static annotations. These are available + * to the Scala type checker, even across different compilation units. + * </p> + * + * @author Martin Odersky + * @version 1.1, 2/02/2007 + * @since 2.4 + */ +trait StaticAnnotation extends Annotation diff --git a/src/library/scala/annotation/TypeConstraint.scala b/src/library/scala/annotation/TypeConstraint.scala new file mode 100644 index 0000000000..2cd8be210f --- /dev/null +++ b/src/library/scala/annotation/TypeConstraint.scala @@ -0,0 +1,28 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2006-2010, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +package scala.annotation + +/** <p> + * A marker for annotations that, when applied to a type, + * should be treated as a constraint on the annotated type. + * A proper constraint should restrict the type based only + * on information mentioned within the type. A Scala compiler + * can use this assumption to rewrite the contents of the + * constraint as necessary. To contrast, a type annotation + * whose meaning depends on the context where it is written + * down is not a proper constrained type, and this marker + * should not be applied. A Scala compiler will drop such + * annotations in cases where it would rewrite a type constraint. + * </p> + * + * @author Lex Spoon + * @version 1.1, 2007-11-5 + * @since 2.6 + */ +trait TypeConstraint extends Annotation 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 |