diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2007-07-20 09:03:20 +0000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2007-07-20 09:03:20 +0000 |
commit | d33a20f0677ca77490bfc40486f0f2c72f14a21d (patch) | |
tree | e0e3da80cfe0abb1d95afe32d57591b8dc150002 /test | |
parent | 1adb565b6e22550d72bf99fb7a527034ed770629 (diff) | |
download | scala-d33a20f0677ca77490bfc40486f0f2c72f14a21d.tar.gz scala-d33a20f0677ca77490bfc40486f0f2c72f14a21d.tar.bz2 scala-d33a20f0677ca77490bfc40486f0f2c72f14a21d.zip |
classOf[Integer] now properly resolves to class...
classOf[Integer] now properly resolves to classOf[java.lang.Integer]
because Predef.Integer (and Character) are @deprecated, had to update
check files to include these warnings
Diffstat (limited to 'test')
-rw-r--r-- | test/files/jvm5/annotations.check | 13 | ||||
-rw-r--r-- | test/files/jvm5/annotations.scala | 3 | ||||
-rw-r--r-- | test/files/neg/variances.check | 10 | ||||
-rw-r--r-- | test/files/neg/variances.scala | 4 |
4 files changed, 27 insertions, 3 deletions
diff --git a/test/files/jvm5/annotations.check b/test/files/jvm5/annotations.check index f01f31d1d9..de725e2513 100644 --- a/test/files/jvm5/annotations.check +++ b/test/files/jvm5/annotations.check @@ -1,3 +1,16 @@ +/Users/adriaan/src/scala/trunk/test/files/jvm5/annotations.scala:131: warning: type Integer in object Predef is deprecated + private var count: Integer = 0 + ^ +/Users/adriaan/src/scala/trunk/test/files/jvm5/annotations.scala:136: warning: type Integer in object Predef is deprecated + getClass().getMethod("setCount", Array[java.lang.Class](classOf[Integer])) + ^ +/Users/adriaan/src/scala/trunk/test/files/jvm5/annotations.scala:138: warning: type Integer in object Predef is deprecated + def get = getter.invoke(this, Array()).asInstanceOf[Integer].intValue + ^ +/Users/adriaan/src/scala/trunk/test/files/jvm5/annotations.scala:139: warning: type Integer in object Predef is deprecated + def set(n: Int) = setter.invoke(this, Array(new Integer(n))) + ^ +four warnings found class java.rmi.RemoteException class java.io.IOException @java.lang.Deprecated() diff --git a/test/files/jvm5/annotations.scala b/test/files/jvm5/annotations.scala index addf2bb07f..4a516a16c4 100644 --- a/test/files/jvm5/annotations.scala +++ b/test/files/jvm5/annotations.scala @@ -125,7 +125,8 @@ object Test4 { object Test5 { import scala.reflect.BeanProperty - import java.lang.Integer +// no need to import java.lang.Integer, Predef.Integer is simply an alias for it +// classOf[Integer] now properly resolves to classOf[java.lang.Integer] class Count { // we use "Integer" instead of "Int" because of Java reflection @BeanProperty diff --git a/test/files/neg/variances.check b/test/files/neg/variances.check index ba894a439d..4934053706 100644 --- a/test/files/neg/variances.check +++ b/test/files/neg/variances.check @@ -1,3 +1,12 @@ +variances.scala:53: warning: type Character in object Predef is deprecated + val a : Foo[Character] = new Foo[Character] + ^ +variances.scala:53: warning: type Character in object Predef is deprecated + val a : Foo[Character] = new Foo[Character] + ^ +variances.scala:58: warning: type Character in object Predef is deprecated + val x : Character = test.a.getA + ^ variances.scala:4: error: covariant type A occurs in contravariant position in type test.Vector[A] of value x def append(x: Vector[A]): Vector[A] ^ @@ -7,4 +16,5 @@ variances.scala:14: error: covariant type A occurs in contravariant position in variances.scala:16: error: covariant type A occurs in invariant position in type test.C[A] with ScalaObject{def this(): object Foo.this.Baz} of object Baz object Baz extends C[A] ^ +three warnings found three errors found diff --git a/test/files/neg/variances.scala b/test/files/neg/variances.scala index 0f9390c186..f84ee8d5d5 100644 --- a/test/files/neg/variances.scala +++ b/test/files/neg/variances.scala @@ -50,12 +50,12 @@ object Covariant { val b : Int = 42 } class Test extends AbstractTest { - val a : Foo[java.lang.Character] = new Foo[java.lang.Character] + val a : Foo[Character] = new Foo[Character] } def main(args : Array[String]) : Unit = { val test = new Test test.c.doit(test.b) - val x : java.lang.Character = test.a.getA + val x : Character = test.a.getA Console.println("XXX " + x) } } |