summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex Spoon <lex@lexspoon.org>2007-09-03 14:12:50 +0000
committerLex Spoon <lex@lexspoon.org>2007-09-03 14:12:50 +0000
commit5a9fbd9d954c53e5818d73bd912398f265d01067 (patch)
treebf0f6aeb3199928df5678b39fc76192f0a2cf60a
parentdfa2cf1c11dc1d787b2147cf53608291fcf13ca7 (diff)
downloadscala-5a9fbd9d954c53e5818d73bd912398f265d01067.tar.gz
scala-5a9fbd9d954c53e5818d73bd912398f265d01067.tar.bz2
scala-5a9fbd9d954c53e5818d73bd912398f265d01067.zip
Deprecate annotations that appear before a type
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index 72ec1d5920..930dbe3710 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -766,7 +766,7 @@ trait Parsers {
}
}
- /** AnnotType ::= Annotations SimpleType Annotations
+ /** AnnotType ::= SimpleType Annotations
* SimpleType ::= SimpleType TypeArgs
* | SimpleType `#' Id
* | StableId
@@ -775,7 +775,13 @@ trait Parsers {
* | WildcardType
*/
def annotType(isPattern: Boolean): Tree = {
- val annots1 = annotations() // Q: deprecate annotations here?
+ val annots1 = annotations()
+ if (!annots1.isEmpty)
+ in.deprecationWarning(
+ annots1.head.pos,
+ "Type annotations should now follow the type")
+ // deprecated on August 13, 2007
+
val pos = inCurrentPos
val t: Tree = annotTypeRest(pos, isPattern,