Fixing more deprecation warnings.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@15756 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
washburn 2008-08-12 14:39:55 +00:00
parent f8fc7646e8
commit ff86e95781
15 changed files with 26 additions and 26 deletions

View File

@ -1,4 +1,4 @@
bug1112.scala:12: error: wrong number of arguments for method call: (int)(=> () => unit)unit
bug1112.scala:12: error: wrong number of arguments for method call: (Int)(=> () => Unit)Unit
call(0,() => System.out.println("here we are"))
^
one error found

View File

@ -2,9 +2,9 @@
// (due to isFunctionType normalizing Type1 to a function type,
// but then the code that used that test not using the normalized type for further operations)
class Test {
type Type1 = () => unit
type Type1 = () => Unit
def call(p: int)(f: => Type1) = {
def call(p: Int)(f: => Type1) = {
f()
}

View File

@ -1,7 +1,7 @@
case class Empty[a] extends IntMap[a];
case class Node[a](left: IntMap[a], keyVal: Pair[int, a], right: IntMap[a]) extends IntMap[a];
case class Node[a](left: IntMap[a], keyVal: Pair[Int, a], right: IntMap[a]) extends IntMap[a];
abstract class IntMap[a] {
def lookup(key: int): a = this match {
def lookup(key: Int): a = this match {
case Empty =>
error("clef inexistante")
case _ =>

View File

@ -1,8 +1,8 @@
constrs.scala:6: error: type T is not a member of object test
def this(y: int)(z: int)(t: this.T) = { this(this.u + y + z); Console.println(x) }
def this(y: Int)(z: Int)(t: this.T) = { this(this.u + y + z); Console.println(x) }
^
constrs.scala:6: error: value u is not a member of object test
def this(y: int)(z: int)(t: this.T) = { this(this.u + y + z); Console.println(x) }
def this(y: Int)(z: Int)(t: this.T) = { this(this.u + y + z); Console.println(x) }
^
constrs.scala:10: error: called constructor's definition must precede calling constructor's definition
def this() = this("abc")

View File

@ -1,12 +1,12 @@
object test {
abstract class Test(x: int) {
abstract class Test(x: Int) {
type T;
val u = x;
def this(y: int)(z: int)(t: this.T) = { this(this.u + y + z); Console.println(x) }
def this(y: Int)(z: Int)(t: this.T) = { this(this.u + y + z); Console.println(x) }
}
class Foo(x: int) {
class Foo(x: Int) {
def this() = this("abc")
def this(x: String) = this(1)
def this(x: boolean) = this(x)

View File

@ -1,4 +1,4 @@
faculty.scala:3: error: recursive method faculty needs result type
def faculty(x: int) = if (x == 0) 1 else x * faculty(x - 1)
def faculty(x: Int) = if (x == 0) 1 else x * faculty(x - 1)
^
one error found

View File

@ -1,5 +1,5 @@
object Test {
def faculty(x: int) = if (x == 0) 1 else x * faculty(x - 1)
def faculty(x: Int) = if (x == 0) 1 else x * faculty(x - 1)
}

View File

@ -1,5 +1,5 @@
abstract class C {
val f: int
val f: Int
}
object A extends C {

View File

@ -3,6 +3,6 @@ object Test {
case List(x) | List() => Console.println(x)
}
List(2) match {
case List(_: int) | List() => Console.println()
case List(_: Int) | List() => Console.println()
}
}

View File

@ -10,7 +10,7 @@ trait Ordered[+a] {
* x == 0 iff this == that
* x > 0 iff this > that
*/
def compareTo [b >: a <% Ordered[b]](that: b): int
def compareTo [b >: a <% Ordered[b]](that: b): Int
def < [b >: a <% Ordered[b]](that: b): boolean = (this compareTo that) < 0
@ -25,13 +25,13 @@ trait Ordered[+a] {
object O {
implicit def view1(x: String): Ordered[String] = new Ordered[String] {
def compareTo [b >: String <% Ordered[b]](y: b): int = y match {
def compareTo [b >: String <% Ordered[b]](y: b): Int = y match {
case y1: String => x compareTo y1
case _ => -(y compareTo x)
}
}
implicit def view2(x: char): Ordered[char] = new Ordered[char] {
def compareTo [b >: char <% Ordered[b]](y: b): int = y match {
def compareTo [b >: char <% Ordered[b]](y: b): Int = y match {
case y1: char => x - y1
case _ => -(y compareTo x)
}
@ -39,11 +39,11 @@ object O {
implicit def view3[a <% Ordered[a]](x: List[a]): Ordered[List[a]] =
new Ordered[List[a]] {
def compareTo [b >: List[a] <% Ordered[b]](y: b): int = y match {
def compareTo [b >: List[a] <% Ordered[b]](y: b): Int = y match {
case y1: List[a] => compareLists(x, y1)
case _ => -(y compareTo x)
}
private def compareLists(xs: List[a], ys: List[a]): int = {
private def compareLists(xs: List[a], ys: List[a]): Int = {
if (xs.isEmpty && ys.isEmpty) 0
else if (xs.isEmpty) -1
else if (ys.isEmpty) 1
@ -77,7 +77,7 @@ class Node[a <% Ordered[a]](elem: a, l: Tree[a], r: Tree[a]) extends Tree[a] {
}
case class Str(elem: String) extends Ordered[Str] {
def compareTo[b >: Str <% Ordered[b]](that: b): int = that match {
def compareTo[b >: Str <% Ordered[b]](that: b): Int = that match {
case that1: Str => this.elem compareTo that1.elem
case _ => -(that compareTo this)
}

View File

@ -10,6 +10,6 @@ def test() {
def myVal: T1 = value
}
Console.println(new B[int](23).myVal)
Console.println(new B[Int](23).myVal)
}
}

View File

@ -1,7 +1,7 @@
class C[a] { def f: a = f; }
class D[b] { class E extends C[b]; }
object Test {
val d = new D[int];
val d = new D[Int];
def e = new d.E;
e.f;
}

View File

@ -10,7 +10,7 @@ object Test extends Application {
object Twice {
def apply(x: Int) = x * 2
def unapply(x: Int): Option[Tuple1[int]] =
def unapply(x: Int): Option[Tuple1[Int]] =
if (x % 2 == 0) Some(Tuple1(x / 2))
else None
}

View File

@ -155,7 +155,7 @@ trait HOSeq {
def map[K](f: T=>K): MapResult[K]
def filter(f: T=>Boolean): FilterResult
def subseq(from: int, to: int): Subseq
def subseq(from: Int, to: Int): Subseq
def flatMap[S <: Seq[K], K](f: T => S): S#Concat // legal?
def concat(others: Seq[T]): Concat
*/

View File

@ -6,7 +6,7 @@ class Async {
class Buffer {
val Put = new Async
//case class Put(x: int)
//case class Put(x: Int)
def joinPat(x: Any): Unit = {
x match {