Permalink
Browse files

Removed a few more @deprecated members.

The ones which remain I'm not removing on purpose, as I know
from experience it's more trouble than it's yet worth.
  • Loading branch information...
paulp committed Apr 28, 2012
1 parent d1460af commit 14144be0bcd3f6823a9622c6f962aed295ef3392
Showing with 59 additions and 91 deletions.
  1. +8 −7 src/compiler/scala/reflect/internal/TreeGen.scala
  2. +7 −6 src/compiler/scala/tools/nsc/javac/JavaParsers.scala
  3. +0 −7 src/library/scala/Predef.scala
  4. +0 −3 src/library/scala/collection/immutable/Range.scala
  5. +0 −13 src/library/scala/package.scala
  6. +1 −1 src/library/scala/reflect/makro/internal/macroImpl.scala
  7. +1 −11 src/library/scala/runtime/package.scala
  8. +2 −2 test/files/neg/annot-nonconst.check
  9. +2 −2 test/files/neg/annot-nonconst.scala
  10. +4 −4 test/files/neg/reify_ann2b.check
  11. +1 −1 test/files/neg/reify_ann2b.scala
  12. +1 −1 test/files/pos/annot-inner.scala
  13. +1 −1 test/files/pos/annotDepMethType.scala
  14. +5 −5 test/files/pos/annotations.scala
  15. +7 −7 test/files/pos/attributes.scala
  16. +1 −1 test/files/pos/spec-annotations.scala
  17. +1 −1 test/files/pos/t1029/Test_1.scala
  18. +1 −1 test/files/pos/t1203.scala
  19. +1 −1 test/files/pos/t1942/A_1.scala
  20. +1 −1 test/files/pos/t2868/pick_1.scala
  21. +1 −1 test/files/pos/t3800.scala
  22. +1 −1 test/files/pos/t3951/Coll_1.scala
  23. +1 −2 test/files/run/bugs.scala
  24. +1 −1 test/files/run/macro-declared-in-annotation/Macros_2.scala
  25. +1 −1 test/files/run/reify_ann1a.scala
  26. +1 −1 test/files/run/reify_ann1b.scala
  27. +1 −1 test/files/run/reify_ann2a.scala
  28. +1 −1 test/files/run/reify_classfileann_a.scala
  29. +1 −1 test/files/run/reify_classfileann_b.scala
  30. +1 −1 test/files/run/t1500.scala
  31. +1 −1 test/files/run/t1501.scala
  32. +1 −1 test/files/run/t5224.scala
  33. +1 −1 test/files/run/t5419.scala
  34. +1 −1 test/files/run/t5423.scala
@@ -7,13 +7,14 @@ abstract class TreeGen extends api.AbsTreeGen {
import global._
import definitions._
def rootId(name: Name) = Select(Ident(nme.ROOTPKG), name)
def rootScalaDot(name: Name) = Select(rootId(nme.scala_) setSymbol ScalaPackage, name)
def scalaDot(name: Name) = Select(Ident(nme.scala_) setSymbol ScalaPackage, name)
def scalaAnyRefConstr = scalaDot(tpnme.AnyRef) setSymbol AnyRefClass
def scalaUnitConstr = scalaDot(tpnme.Unit) setSymbol UnitClass
def productConstr = scalaDot(tpnme.Product) setSymbol ProductRootClass
def serializableConstr = scalaDot(tpnme.Serializable) setSymbol SerializableClass
def rootId(name: Name) = Select(Ident(nme.ROOTPKG), name)
def rootScalaDot(name: Name) = Select(rootId(nme.scala_) setSymbol ScalaPackage, name)
def scalaDot(name: Name) = Select(Ident(nme.scala_) setSymbol ScalaPackage, name)
def scalaAnnotationDot(name: Name) = Select(scalaDot(nme.annotation), name)
def scalaAnyRefConstr = scalaDot(tpnme.AnyRef) setSymbol AnyRefClass
def scalaUnitConstr = scalaDot(tpnme.Unit) setSymbol UnitClass
def productConstr = scalaDot(tpnme.Product) setSymbol ProductRootClass
def serializableConstr = scalaDot(tpnme.Serializable) setSymbol SerializableClass
def scalaFunctionConstr(argtpes: List[Tree], restpe: Tree, abstractFun: Boolean = false): Tree = {
val cls = if (abstractFun)
@@ -789,23 +789,24 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
val idefs = members.toList ::: (sdefs flatMap forwarders)
(sdefs, idefs)
}
def annotationParents = List(
gen.scalaAnnotationDot(tpnme.Annotation),
Select(javaLangDot(nme.annotation), tpnme.Annotation),
gen.scalaAnnotationDot(tpnme.ClassfileAnnotation)
)
def annotationDecl(mods: Modifiers): List[Tree] = {
accept(AT)
accept(INTERFACE)
val pos = in.currentPos
val name = identForType()
val parents = List(scalaDot(tpnme.Annotation),
Select(javaLangDot(nme.annotation), tpnme.Annotation),
scalaDot(tpnme.ClassfileAnnotation))
val (statics, body) = typeBody(AT, name)
def getValueMethodType(tree: Tree) = tree match {
case DefDef(_, nme.value, _, _, tpt, _) => Some(tpt.duplicate)
case _ => None
}
var templ = makeTemplate(parents, body)
var templ = makeTemplate(annotationParents, body)
for (stat <- templ.body; tpt <- getValueMethodType(stat))
templ = makeTemplate(parents, makeConstructor(List(tpt)) :: templ.body)
templ = makeTemplate(annotationParents, makeConstructor(List(tpt)) :: templ.body)
addCompanionObject(statics, atPos(pos) {
ClassDef(mods, name, List(), templ)
})
@@ -468,13 +468,6 @@ object Predef extends LowPriorityImplicits {
implicit def tpEquals[A]: A =:= A = singleton_=:=.asInstanceOf[A =:= A]
}
// less useful due to #2781
@deprecated("Use From => To instead", "2.9.0")
sealed abstract class <%<[-From, +To] extends (From => To) with Serializable
object <%< {
implicit def conformsOrViewsAs[A <% B, B]: A <%< B = new (A <%< B) {def apply(x: A) = x}
}
/** A type for which there is always an implicit value.
* @see fallbackCanBuildFrom in Array.scala
*/
@@ -398,7 +398,4 @@ object Range {
def apply(start: Int, end: Int, step: Int) = NumericRange(start, end, step)
def inclusive(start: Int, end: Int, step: Int) = NumericRange.inclusive(start, end, step)
}
@deprecated("use Range instead", "2.9.0")
trait ByOne extends Range
}
@@ -80,10 +80,6 @@ package object scala {
type Range = scala.collection.immutable.Range
val Range = scala.collection.immutable.Range
// Migrated from Predef
@deprecated("Use Thread.currentThread instead", "2.9.0")
def currentThread = java.lang.Thread.currentThread()
// Numeric types which were moved into scala.math.*
type BigDecimal = scala.math.BigDecimal
@@ -127,13 +123,4 @@ package object scala {
type unchecked = annotation.unchecked.unchecked
type volatile = annotation.volatile
*/
@deprecated("use scala.annotation.Annotation instead", "2.9.0")
type Annotation = scala.annotation.Annotation
@deprecated("use scala.annotation.ClassfileAnnotation instead", "2.9.0")
type ClassfileAnnotation = scala.annotation.ClassfileAnnotation
@deprecated("use scala.annotation.StaticAnnotation instead", "2.9.0")
type StaticAnnotation = scala.annotation.StaticAnnotation
@deprecated("use scala.annotation.TypeConstraint instead", "2.9.0")
type TypeConstraint = scala.annotation.TypeConstraint
}
@@ -2,4 +2,4 @@ package scala.reflect.makro
package internal
/** This type is required by the compiler and <b>should not be used in client code</b>. */
class macroImpl(val referenceToMacroImpl: Any) extends StaticAnnotation
class macroImpl(val referenceToMacroImpl: Any) extends annotation.StaticAnnotation
@@ -1,13 +1,3 @@
package scala
package object runtime {
@deprecated("Use `scala.Unit` instead.", "2.9.0") val Unit = scala.Unit
@deprecated("Use `scala.Boolean` instead.", "2.9.0") val Boolean = scala.Boolean
@deprecated("Use `scala.Byte` instead.", "2.9.0") val Byte = scala.Byte
@deprecated("Use `scala.Short` instead.", "2.9.0") val Short = scala.Short
@deprecated("Use `scala.Char` instead.", "2.9.0") val Char = scala.Char
@deprecated("Use `scala.Int` instead.", "2.9.0") val Int = scala.Int
@deprecated("Use `scala.Long` instead.", "2.9.0") val Long = scala.Long
@deprecated("Use `scala.Float` instead.", "2.9.0") val Float = scala.Float
@deprecated("Use `scala.Double` instead.", "2.9.0") val Double = scala.Double
}
package object runtime { }
@@ -1,12 +1,12 @@
annot-nonconst.scala:1: warning: Implementation restriction: subclassing Classfile does not
make your annotation visible at runtime. If that is what
you want, you must write the annotation class in Java.
class Length(value: Int) extends ClassfileAnnotation
class Length(value: Int) extends annotation.ClassfileAnnotation
^
annot-nonconst.scala:2: warning: Implementation restriction: subclassing Classfile does not
make your annotation visible at runtime. If that is what
you want, you must write the annotation class in Java.
class Ann2(value: String) extends ClassfileAnnotation
class Ann2(value: String) extends annotation.ClassfileAnnotation
^
annot-nonconst.scala:6: error: annotation argument needs to be a constant; found: n
@Length(n) def foo = "foo"
@@ -1,5 +1,5 @@
class Length(value: Int) extends ClassfileAnnotation
class Ann2(value: String) extends ClassfileAnnotation
class Length(value: Int) extends annotation.ClassfileAnnotation
class Ann2(value: String) extends annotation.ClassfileAnnotation
object Test {
def n = 15
@@ -1,4 +1,4 @@
reify_ann2b.scala:6: error: inner classes cannot be classfile annotations
class ann(bar: String) extends ClassfileAnnotation
^
one error found
reify_ann2b.scala:6: error: inner classes cannot be classfile annotations
class ann(bar: String) extends annotation.ClassfileAnnotation
^
one error found
@@ -3,7 +3,7 @@ import scala.reflect.mirror._
object Test extends App {
// test 1: reify
val tree = reify{
class ann(bar: String) extends ClassfileAnnotation
class ann(bar: String) extends annotation.ClassfileAnnotation
@ann(bar="1a") @ann(bar="1b") class C[@ann(bar="2a") @ann(bar="2b") T](@ann(bar="3a") @ann(bar="3b") x: T @ann(bar="4a") @ann(bar="4b")) {
@ann(bar="5a") @ann(bar="5b") def f(x: Int @ann(bar="6a") @ann(bar="6b")) = {
@@ -1,5 +1,5 @@
object test {
class annot extends Annotation
class annot extends scala.annotation.Annotation
def foo {
@annot def bar(i: Int): Int = i
@@ -1,4 +1,4 @@
case class pc(calls: Any*) extends TypeConstraint
case class pc(calls: Any*) extends annotation.TypeConstraint
object Main {
class C0 { def baz: String = "" }
@@ -1,5 +1,5 @@
class ann(i: Int) extends Annotation
class cfann(x: String) extends ClassfileAnnotation
class ann(i: Int) extends scala.annotation.Annotation
class cfann(x: String) extends annotation.ClassfileAnnotation
// annotations on abstract types
abstract class C1[@serializable @cloneable +T, U, V[_]]
@@ -91,9 +91,9 @@ trait BeanF {
}
class Ann3(arr: Array[String]) extends ClassfileAnnotation
class Ann4(i: Int) extends ClassfileAnnotation
class Ann5(value: Class[_]) extends ClassfileAnnotation
class Ann3(arr: Array[String]) extends annotation.ClassfileAnnotation
class Ann4(i: Int) extends annotation.ClassfileAnnotation
class Ann5(value: Class[_]) extends annotation.ClassfileAnnotation
object Test3 {
final val i = 1083
@@ -52,15 +52,15 @@ object O6 {
}
object myAttrs {
class a1 extends scala.Annotation;
class a2(x: Int) extends scala.Annotation;
class a3(x: a1) extends scala.Annotation;
class a1 extends scala.annotation.Annotation;
class a2(x: Int) extends scala.annotation.Annotation;
class a3(x: a1) extends scala.annotation.Annotation;
}
class a4(ns: Array[Int]) extends scala.Annotation;
class a4(ns: Array[Int]) extends scala.annotation.Annotation;
object O7 {
class a1 extends scala.Annotation;
class a2(x: Int) extends scala.Annotation;
class a3(x: a1) extends scala.Annotation;
class a1 extends scala.annotation.Annotation;
class a2(x: Int) extends scala.annotation.Annotation;
class a3(x: a1) extends scala.annotation.Annotation;
final val x = new a1;
@a1 class C1;
@@ -1,4 +1,4 @@
class ann(i: Int) extends Annotation
class ann(i: Int) extends scala.annotation.Annotation
// annotations on abstract types
abstract class C1[@serializable @cloneable +T, U, V[_]]
@@ -1,4 +1,4 @@
class ann(a: Array[Int]) extends StaticAnnotation
class ann(a: Array[Int]) extends annotation.StaticAnnotation
object Test1 {
// bug #1029
@@ -1,4 +1,4 @@
case class ant(t: String) extends Annotation
case class ant(t: String) extends scala.annotation.Annotation
object Test {
def main(args: Array[String]): Unit = {
val a: scala.xml.NodeSeq @ant("12") = Nil
@@ -3,7 +3,7 @@ class A {
def foo(x: String) = 1
}
class ann(x: Int) extends StaticAnnotation
class ann(x: Int) extends annotation.StaticAnnotation
class t {
val a = new A
@@ -1,4 +1,4 @@
class ann(s: String) extends StaticAnnotation
class ann(s: String) extends annotation.StaticAnnotation
class pick {
final val s = "bang!"
@ann("bang!") def foo = 1
@@ -1,4 +1,4 @@
class meh extends StaticAnnotation
class meh extends annotation.StaticAnnotation
class ALike[C]
abstract class AFactory[CC[x] <: ALike[CC[x]]] {
@@ -15,7 +15,7 @@ sealed trait DynamicDocument extends Document {
class Coll extends StaticDocument
// similiar issue with annotations
class ann[T] extends StaticAnnotation
class ann[T] extends annotation.StaticAnnotation
trait StatDoc extends Doc {
@ann[StatFB]
@@ -445,8 +445,7 @@ object Test {
test;
} catch {
case exception =>
val curr: String = currentThread.toString();
Console.print("Exception in thread \"" + curr + "\" " + exception);
Console.print("Exception in thread \"" + Thread.currentThread + "\" " + exception);
Console.println;
errors += 1
}
@@ -1,4 +1,4 @@
class foo(val bar: String) extends StaticAnnotation
class foo(val bar: String) extends annotation.StaticAnnotation
object Api {
// foo in ann must have a different name
@@ -1,6 +1,6 @@
import scala.reflect.mirror._
class ann(bar: List[String]) extends StaticAnnotation
class ann(bar: List[String]) extends annotation.StaticAnnotation
object Test extends App {
// test 1: reify
@@ -1,6 +1,6 @@
import scala.reflect.mirror._
class ann(bar: String) extends ClassfileAnnotation
class ann(bar: String) extends annotation.ClassfileAnnotation
object Test extends App {
// test 1: reify
@@ -3,7 +3,7 @@ import scala.reflect.mirror._
object Test extends App {
// test 1: reify
val tree = reify{
class ann(bar: List[String]) extends StaticAnnotation
class ann(bar: List[String]) extends annotation.StaticAnnotation
@ann(bar=List("1a")) @ann(bar=List("1b")) class C[@ann(bar=List("2a")) @ann(bar=List("2b")) T](@ann(bar=List("3a")) @ann(bar=List("3b")) x: T @ann(bar=List("4a")) @ann(bar=List("4b"))) {
@ann(bar=List("5a")) @ann(bar=List("5b")) def f(x: Int @ann(bar=List("6a")) @ann(bar=List("6b"))) = {
@@ -1,6 +1,6 @@
import scala.reflect.mirror._
class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends ClassfileAnnotation
class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation
object Test extends App {
// test 1: reify
@@ -1,6 +1,6 @@
import scala.reflect.mirror._
class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends ClassfileAnnotation
class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation
object Test extends App {
// test 1: reify
@@ -8,7 +8,7 @@ object Test {
val testCode = <code>
class posingAs[A] extends TypeConstraint
class posingAs[A] extends annotation.TypeConstraint
def resolve[A,B](x: A @posingAs[B]): B = x.asInstanceOf[B]
@@ -8,7 +8,7 @@ object Test {
val testCode = <code>
class xyz[A] extends TypeConstraint
class xyz[A] extends annotation.TypeConstraint
def loopWhile[T](cond: =>Boolean)(body: =>(Unit @xyz[T])): Unit @ xyz[T] = {{
if (cond) {{
@@ -1,6 +1,6 @@
import scala.reflect.mirror._
class Foo(bar: String) extends ClassfileAnnotation
class Foo(bar: String) extends annotation.ClassfileAnnotation
object Test extends App {
val tree = reify{@Foo(bar = "qwe") class C}.tree
@@ -1,6 +1,6 @@
import scala.reflect.mirror._
class Foo extends StaticAnnotation
class Foo extends annotation.StaticAnnotation
object Test extends App {
val tree = reify{(5: @Foo).asInstanceOf[Int]}.tree
@@ -1,6 +1,6 @@
import scala.reflect.mirror._
final class table extends StaticAnnotation
final class table extends annotation.StaticAnnotation
@table class A
object Test extends App {

2 comments on commit 14144be

@soc

This comment has been minimized.

Show comment
Hide comment
@soc

soc Apr 29, 2012

Member

Too bad this didn't go into 2.10 M3 anymore. Would have been useful to see if it breaks code for anyone out there in M3.

Member

soc replied Apr 29, 2012

Too bad this didn't go into 2.10 M3 anymore. Would have been useful to see if it breaks code for anyone out there in M3.

@gkossakowski

This comment has been minimized.

Show comment
Hide comment
@gkossakowski

gkossakowski Apr 29, 2012

Member

Yup, that's why we need M4.

Member

gkossakowski replied Apr 29, 2012

Yup, that's why we need M4.

Please sign in to comment.