summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-02-11 08:53:14 -0800
committerPaul Phillips <paulp@improving.org>2013-02-12 11:01:13 -0800
commitc26a8db067e4f04ef959bb9a8402fa3e931c3cd7 (patch)
tree8e920c4fd9ae5182c4175ca40d731dd36c004963 /test/files/neg
parent0c59fc9a1416cf5c45699111e8857adb03f7f0d4 (diff)
downloadscala-c26a8db067e4f04ef959bb9a8402fa3e931c3cd7.tar.gz
scala-c26a8db067e4f04ef959bb9a8402fa3e931c3cd7.tar.bz2
scala-c26a8db067e4f04ef959bb9a8402fa3e931c3cd7.zip
Maintenance of Predef.
1) Deprecates much of Predef and scala.Console, especially: - the read* methods (see below) - the set{Out,Err,In} methods (see SI-4793) 2) Removed long-deprecated: - Predef#exit - Predef#error should have gone, but could not due to sbt At least the whole source base has now been future-proofed against the eventual removal of Predef#error. The low justification for the read* methods should be readily apparent: they are little used and have no call to be in global namespace, especially given their weird ad hoc semantics and unreasonably tempting names such as readBoolean(). 3) Segregated the deprecated elements in Predef from the part which still thrives. 4) Converted all the standard Predef implicits into implicit classes, value classes where possible: - ArrowAssoc, Ensuring, StringFormat, StringAdd, RichException (value) - SeqCharSequence, ArrayCharSequence (non-value) Non-implicit deprecated stubs prop up the names of the formerly converting methods.
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/classmanifests_new_deprecations.check10
-rw-r--r--test/files/neg/logImplicits.check4
-rw-r--r--test/files/neg/predef-masking.scala2
-rw-r--r--test/files/neg/t1010.scala4
-rw-r--r--test/files/neg/t414.scala2
-rw-r--r--test/files/neg/t421.check2
-rw-r--r--test/files/neg/t421.scala2
-rw-r--r--test/files/neg/t4271.scala4
8 files changed, 15 insertions, 15 deletions
diff --git a/test/files/neg/classmanifests_new_deprecations.check b/test/files/neg/classmanifests_new_deprecations.check
index fddd6bf5b4..5f9d0a1ccc 100644
--- a/test/files/neg/classmanifests_new_deprecations.check
+++ b/test/files/neg/classmanifests_new_deprecations.check
@@ -1,13 +1,13 @@
-classmanifests_new_deprecations.scala:2: warning: type ClassManifest in object Predef is deprecated: Use scala.reflect.ClassTag instead
+classmanifests_new_deprecations.scala:2: warning: type ClassManifest in object Predef is deprecated: Use `scala.reflect.ClassTag` instead
def cm1[T: ClassManifest] = ???
^
-classmanifests_new_deprecations.scala:3: warning: type ClassManifest in object Predef is deprecated: Use scala.reflect.ClassTag instead
+classmanifests_new_deprecations.scala:3: warning: type ClassManifest in object Predef is deprecated: Use `scala.reflect.ClassTag` instead
def cm2[T](implicit evidence$1: ClassManifest[T]) = ???
^
-classmanifests_new_deprecations.scala:4: warning: type ClassManifest in object Predef is deprecated: Use scala.reflect.ClassTag instead
+classmanifests_new_deprecations.scala:4: warning: type ClassManifest in object Predef is deprecated: Use `scala.reflect.ClassTag` instead
val cm3: ClassManifest[Int] = null
^
-classmanifests_new_deprecations.scala:4: warning: type ClassManifest in object Predef is deprecated: Use scala.reflect.ClassTag instead
+classmanifests_new_deprecations.scala:4: warning: type ClassManifest in object Predef is deprecated: Use `scala.reflect.ClassTag` instead
val cm3: ClassManifest[Int] = null
^
classmanifests_new_deprecations.scala:6: warning: type ClassManifest in package reflect is deprecated: Use scala.reflect.ClassTag instead
@@ -22,7 +22,7 @@ classmanifests_new_deprecations.scala:8: warning: type ClassManifest in package
classmanifests_new_deprecations.scala:8: warning: type ClassManifest in package reflect is deprecated: Use scala.reflect.ClassTag instead
val rcm3: scala.reflect.ClassManifest[Int] = null
^
-classmanifests_new_deprecations.scala:10: warning: type ClassManifest in object Predef is deprecated: Use scala.reflect.ClassTag instead
+classmanifests_new_deprecations.scala:10: warning: type ClassManifest in object Predef is deprecated: Use `scala.reflect.ClassTag` instead
type CM[T] = ClassManifest[T]
^
classmanifests_new_deprecations.scala:15: warning: type ClassManifest in package reflect is deprecated: Use scala.reflect.ClassTag instead
diff --git a/test/files/neg/logImplicits.check b/test/files/neg/logImplicits.check
index 54afc6f86d..0522bd8354 100644
--- a/test/files/neg/logImplicits.check
+++ b/test/files/neg/logImplicits.check
@@ -7,10 +7,10 @@ logImplicits.scala:7: applied implicit conversion from String("abc") to ?{def ma
logImplicits.scala:15: inferred view from String("abc") to Int = C.this.convert:(p: String("abc"))Int
math.max(122, x: Int)
^
-logImplicits.scala:19: applied implicit conversion from Int(1) to ?{def ->: ?} = implicit def any2ArrowAssoc[A](x: A): ArrowAssoc[A]
+logImplicits.scala:19: applied implicit conversion from Int(1) to ?{def ->: ?} = implicit def ArrowAssoc[A](__leftOfArrow: A): ArrowAssoc[A]
def f = (1 -> 2) + "c"
^
-logImplicits.scala:19: applied implicit conversion from (Int, Int) to ?{def +: ?} = implicit def any2stringadd(x: Any): scala.runtime.StringAdd
+logImplicits.scala:19: applied implicit conversion from (Int, Int) to ?{def +: ?} = implicit def StringAdd[A](__thingToAdd: A): StringAdd[A]
def f = (1 -> 2) + "c"
^
logImplicits.scala:22: error: class Un needs to be abstract, since method unimplemented is not defined
diff --git a/test/files/neg/predef-masking.scala b/test/files/neg/predef-masking.scala
index 67b69aa169..6f4f4859d0 100644
--- a/test/files/neg/predef-masking.scala
+++ b/test/files/neg/predef-masking.scala
@@ -1,5 +1,5 @@
// Testing predef masking
-import Predef.{ any2stringadd => _, _ }
+import Predef.{ StringAdd => _, _ }
object StringPlusConfusion {
// Would love to do something about this error message, but by the
diff --git a/test/files/neg/t1010.scala b/test/files/neg/t1010.scala
index 7a1e6615e5..fd142978ec 100644
--- a/test/files/neg/t1010.scala
+++ b/test/files/neg/t1010.scala
@@ -6,9 +6,9 @@ class MailBox {
abstract class Actor {
private val in = new MailBox
- def send(msg: in.Message) = error("foo")
+ def send(msg: in.Message) = sys.error("foo")
- def unstable: Actor = error("foo")
+ def unstable: Actor = sys.error("foo")
def dubiousSend(msg: MailBox#Message): Nothing =
unstable.send(msg) // in.Message becomes unstable.Message, but that's ok since Message is a concrete type member
diff --git a/test/files/neg/t414.scala b/test/files/neg/t414.scala
index 2bc83eedcb..1662b9a105 100644
--- a/test/files/neg/t414.scala
+++ b/test/files/neg/t414.scala
@@ -3,7 +3,7 @@ case class Node[a](left: IntMap[a], keyVal: Pair[Int, a], right: IntMap[a]) exte
abstract class IntMap[a] {
def lookup(key: Int): a = this match {
case Empty =>
- error("clef inexistante")
+ sys.error("clef inexistante")
case _ =>
};
diff --git a/test/files/neg/t421.check b/test/files/neg/t421.check
index e81df52ab0..dc5fa425ac 100644
--- a/test/files/neg/t421.check
+++ b/test/files/neg/t421.check
@@ -1,4 +1,4 @@
t421.scala:5: error: star patterns must correspond with varargs parameters
- case Bar("foo",_*) => error("huh?");
+ case Bar("foo",_*) => sys.error("huh?");
^
one error found
diff --git a/test/files/neg/t421.scala b/test/files/neg/t421.scala
index 43f6c9dafd..9a327be896 100644
--- a/test/files/neg/t421.scala
+++ b/test/files/neg/t421.scala
@@ -2,7 +2,7 @@ object foo {
case class Bar(a:String, b:AnyRef, c:String*);
Bar("foo","meets","bar") match {
- case Bar("foo",_*) => error("huh?");
+ case Bar("foo",_*) => sys.error("huh?");
}
}
diff --git a/test/files/neg/t4271.scala b/test/files/neg/t4271.scala
index 50526c8958..46ae3ad9ec 100644
--- a/test/files/neg/t4271.scala
+++ b/test/files/neg/t4271.scala
@@ -1,11 +1,11 @@
object foo {
object Donotuseme
- implicit def any2Ensuring[A](x: A) = Donotuseme
+ implicit def Ensuring[A](x: A) = Donotuseme
implicit def doubleWrapper(x: Int) = Donotuseme
implicit def floatWrapper(x: Int) = Donotuseme
implicit def intWrapper(x: Int) = Donotuseme
implicit def longWrapper(x: Int) = Donotuseme
- implicit def any2ArrowAssoc[A](x: A) = Donotuseme
+ implicit def ArrowAssoc[A](x: A) = Donotuseme
3 to 5
5 ensuring true
3 -> 5